aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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 {