From ea5d34b5102e75557668f85c6f3124ea5417a219 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 29 Dec 2021 20:55:49 -0800 Subject: Fix protocol response --- src/main/java/org/traccar/protocol/NavtelecomProtocolDecoder.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/main/java/org/traccar/protocol') diff --git a/src/main/java/org/traccar/protocol/NavtelecomProtocolDecoder.java b/src/main/java/org/traccar/protocol/NavtelecomProtocolDecoder.java index bdcc12c4c..8314442a3 100644 --- a/src/main/java/org/traccar/protocol/NavtelecomProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/NavtelecomProtocolDecoder.java @@ -235,12 +235,11 @@ public class NavtelecomProtocolDecoder extends BaseProtocolDecoder { positions.add(position); } - int checksum = buf.readUnsignedByte(); if (channel != null) { ByteBuf response = Unpooled.buffer(); response.writeCharSequence(type, StandardCharsets.US_ASCII); response.writeByte(count); - response.writeByte(checksum); + response.writeByte(Checksum.xor(response.nioBuffer())); channel.writeAndFlush(new NetworkMessage(response, remoteAddress)); } -- cgit v1.2.3