aboutsummaryrefslogtreecommitdiff
path: root/src
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
parentcbddcd311a777f0fbe1dcea4105b01ef0ffa4e34 (diff)
downloadtraccar-server-5b4ab0d3fb7a04ddb3b062159329dd258137ac62.tar.gz
traccar-server-5b4ab0d3fb7a04ddb3b062159329dd258137ac62.tar.bz2
traccar-server-5b4ab0d3fb7a04ddb3b062159329dd258137ac62.zip
Minor fix for message type parser
Diffstat (limited to 'src')
-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 {