private Position parseCommandResponse(Channel channel, SocketAddress remoteAddress, ChannelBuffer buf) {
DeviceSession deviceSession = getDeviceSession(channel, remoteAddress);
if (deviceSession == null) {
return null;
}
Position position = new Position();
position.setProtocol(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
getLastLocation(position, null);
int responseTextLength = buf.bytesBefore((byte) 0);
if (responseTextLength < 0) {
responseTextLength = CMD_RESPONSE_SIZE - 3;
}
position.set(Position.KEY_RESULT, buf.readBytes(responseTextLength).toString(StandardCharsets.UTF_8));
return position;
}
AdmProtocolDecoder.java 文件源码
java
阅读 34
收藏 0
点赞 0
评论 0
项目:traccar-service
作者:
评论列表
文章目录