aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/CastelProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-06 16:55:31 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-06 16:55:31 +1300
commit2b9187ac736feeb661e2814af8fa534a335998d4 (patch)
tree18e89d33116194bc5f2fa90ea48b169608b81a76 /src/org/traccar/protocol/CastelProtocolDecoder.java
parent6652e4c3e23da63d4277caaca7f91e651793f503 (diff)
downloadtrackermap-server-2b9187ac736feeb661e2814af8fa534a335998d4.tar.gz
trackermap-server-2b9187ac736feeb661e2814af8fa534a335998d4.tar.bz2
trackermap-server-2b9187ac736feeb661e2814af8fa534a335998d4.zip
Clean up CRC-16 implementations
Diffstat (limited to 'src/org/traccar/protocol/CastelProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/CastelProtocolDecoder.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/CastelProtocolDecoder.java b/src/org/traccar/protocol/CastelProtocolDecoder.java
index f93b9762c..d7c6bbf46 100644
--- a/src/org/traccar/protocol/CastelProtocolDecoder.java
+++ b/src/org/traccar/protocol/CastelProtocolDecoder.java
@@ -95,7 +95,7 @@ public class CastelProtocolDecoder extends BaseProtocolDecoder {
response.writeByte(version);
response.writeBytes(id);
response.writeShort(ChannelBuffers.swapShort(MSG_HEARTBEAT_RESPONSE));
- response.writeShort(Checksum.crc16Ccitt(response.toByteBuffer(0, response.writerIndex())));
+ response.writeShort(Checksum.crc16(Checksum.CRC16_X25, response.toByteBuffer(0, response.writerIndex())));
response.writeByte(0x0D); response.writeByte(0x0A);
channel.write(response, remoteAddress);
}
@@ -123,7 +123,7 @@ public class CastelProtocolDecoder extends BaseProtocolDecoder {
response.writeInt(0xFFFFFFFF);
response.writeShort(0);
response.writeInt((int) (System.currentTimeMillis() / 1000));
- response.writeShort(Checksum.crc16Ccitt(response.toByteBuffer(0, response.writerIndex())));
+ response.writeShort(Checksum.crc16(Checksum.CRC16_X25, response.toByteBuffer(0, response.writerIndex())));
response.writeByte(0x0D); response.writeByte(0x0A);
channel.write(response, remoteAddress);
}