aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/NavisProtocolDecoder.java
diff options
context:
space:
mode:
authorEvgeny S Maksimov <me@vragam.net>2019-01-28 23:49:31 +0300
committerEvgeny S Maksimov <me@vragam.net>2019-01-28 23:49:31 +0300
commit5b4ab0d3fb7a04ddb3b062159329dd258137ac62 (patch)
tree8d98d433f1db3c61e15fac6b59550fc855c6cda0 /src/org/traccar/protocol/NavisProtocolDecoder.java
parentcbddcd311a777f0fbe1dcea4105b01ef0ffa4e34 (diff)
downloadtrackermap-server-5b4ab0d3fb7a04ddb3b062159329dd258137ac62.tar.gz
trackermap-server-5b4ab0d3fb7a04ddb3b062159329dd258137ac62.tar.bz2
trackermap-server-5b4ab0d3fb7a04ddb3b062159329dd258137ac62.zip
Minor fix for message type parser
Diffstat (limited to 'src/org/traccar/protocol/NavisProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/NavisProtocolDecoder.java10
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 {