aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-06-28 04:22:45 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-06-28 04:22:45 +1200
commit4d6229c7daa4a7b8f28337c5eca9a422876c98b1 (patch)
treeb35c98bfd40b25ccc82f88d6e248f346f33d2cb4 /src/org
parentc700bfdb66071ba224ddf01e9827e721562fed7a (diff)
downloadtrackermap-server-4d6229c7daa4a7b8f28337c5eca9a422876c98b1.tar.gz
trackermap-server-4d6229c7daa4a7b8f28337c5eca9a422876c98b1.tar.bz2
trackermap-server-4d6229c7daa4a7b8f28337c5eca9a422876c98b1.zip
Append AutoTrack message checksum
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/protocol/AutoTrackProtocolDecoder.java2
1 files changed, 2 insertions, 0 deletions
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;