From 4d6229c7daa4a7b8f28337c5eca9a422876c98b1 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 28 Jun 2018 04:22:45 +1200 Subject: Append AutoTrack message checksum --- src/org/traccar/protocol/AutoTrackProtocolDecoder.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/org') diff --git a/src/org/traccar/protocol/AutoTrackProtocolDecoder.java b/src/org/traccar/protocol/AutoTrackProtocolDecoder.java index 370c561d9..93bba4678 100644 --- a/src/org/traccar/protocol/AutoTrackProtocolDecoder.java +++ b/src/org/traccar/protocol/AutoTrackProtocolDecoder.java @@ -22,6 +22,7 @@ import io.netty.channel.Channel; import org.traccar.BaseProtocolDecoder; import org.traccar.DeviceSession; import org.traccar.NetworkMessage; +import org.traccar.helper.Checksum; import org.traccar.helper.UnitsConverter; import org.traccar.model.Position; @@ -102,6 +103,7 @@ public class AutoTrackProtocolDecoder extends BaseProtocolDecoder { response.writeBytes(ByteBufUtil.decodeHexDump(imei)); response.writeShortLE(fuelConst); response.writeShortLE(tripConst); + response.writeShort(Checksum.crc16(Checksum.CRC16_XMODEM, response.nioBuffer())); channel.writeAndFlush(new NetworkMessage(response, remoteAddress)); } return null; -- cgit v1.2.3