diff options
author | Evgeny S Maksimov <me@vragam.net> | 2019-01-28 23:49:31 +0300 |
---|---|---|
committer | Evgeny S Maksimov <me@vragam.net> | 2019-01-28 23:49:31 +0300 |
commit | 5b4ab0d3fb7a04ddb3b062159329dd258137ac62 (patch) | |
tree | 8d98d433f1db3c61e15fac6b59550fc855c6cda0 | |
parent | cbddcd311a777f0fbe1dcea4105b01ef0ffa4e34 (diff) | |
download | trackermap-server-5b4ab0d3fb7a04ddb3b062159329dd258137ac62.tar.gz trackermap-server-5b4ab0d3fb7a04ddb3b062159329dd258137ac62.tar.bz2 trackermap-server-5b4ab0d3fb7a04ddb3b062159329dd258137ac62.zip |
Minor fix for message type parser
-rw-r--r-- | src/org/traccar/protocol/NavisProtocolDecoder.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/org/traccar/protocol/NavisProtocolDecoder.java b/src/org/traccar/protocol/NavisProtocolDecoder.java index decfae63f..582eccf3a 100644 --- a/src/org/traccar/protocol/NavisProtocolDecoder.java +++ b/src/org/traccar/protocol/NavisProtocolDecoder.java @@ -693,6 +693,11 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder { private Object decodeFlex(Channel channel, SocketAddress remoteAddress, ByteBuf buf) { + if (buf.getByte(buf.readerIndex()) == 0x7F) { + // Keep alive message + return null; + } + String type = buf.toString(buf.readerIndex(), 2, StandardCharsets.US_ASCII); buf.skipBytes(type.length()); @@ -728,11 +733,6 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder { ByteBuf buf = (ByteBuf) msg; - if (buf.getByte(buf.readerIndex()) == 0x7F) { - // FLEX keep alive message - return null; - } - if (flexDataSize > 0) { return decodeFlex(channel, remoteAddress, buf); } else { |