aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-03-18 17:02:42 -0700
committerAnton Tananaev <anton@traccar.org>2022-03-18 17:02:42 -0700
commitb0b9cdb254eb5031c744be1029d87aaf2802b674 (patch)
tree368e62a82509932312cbbfd00c59b422924f3e8b /src/main
parent143a51790b613831e455d49299098d97aff34bfa (diff)
downloadtrackermap-server-b0b9cdb254eb5031c744be1029d87aaf2802b674.tar.gz
trackermap-server-b0b9cdb254eb5031c744be1029d87aaf2802b674.tar.bz2
trackermap-server-b0b9cdb254eb5031c744be1029d87aaf2802b674.zip
Handle heartbeat messages (fix #4824)
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/protocol/NavtelecomFrameDecoder.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/NavtelecomFrameDecoder.java b/src/main/java/org/traccar/protocol/NavtelecomFrameDecoder.java
index 0fb82528b..2ab7d11a9 100644
--- a/src/main/java/org/traccar/protocol/NavtelecomFrameDecoder.java
+++ b/src/main/java/org/traccar/protocol/NavtelecomFrameDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021 Anton Tananaev (anton@traccar.org)
+ * Copyright 2021 - 2022 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,7 +30,12 @@ public class NavtelecomFrameDecoder extends BaseFrameDecoder {
protected Object decode(
ChannelHandlerContext ctx, Channel channel, ByteBuf buf) throws Exception {
- if (buf.getByte(buf.readerIndex()) == '@') {
+ if (buf.getByte(buf.readerIndex()) == 0x7f) {
+
+ buf.skipBytes(1);
+ return null;
+
+ } else if (buf.getByte(buf.readerIndex()) == '@') {
int length = buf.getUnsignedShortLE(12) + 12 + 2 + 2;
if (buf.readableBytes() >= length) {