aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/helper/Checksum.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-07-09 19:25:58 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2017-07-09 19:25:58 +1200
commit360940ff6a048a22c61f1d0c3480e9900c15ee58 (patch)
tree981a3ff10d09653777b285758991eb5a17d492cd /src/org/traccar/helper/Checksum.java
parente8e3aab79e97fa236a5ec7ce7ac448015c86e7c9 (diff)
downloadtrackermap-server-360940ff6a048a22c61f1d0c3480e9900c15ee58.tar.gz
trackermap-server-360940ff6a048a22c61f1d0c3480e9900c15ee58.tar.bz2
trackermap-server-360940ff6a048a22c61f1d0c3480e9900c15ee58.zip
Implement GalileoSky protocol commands
Diffstat (limited to 'src/org/traccar/helper/Checksum.java')
-rw-r--r--src/org/traccar/helper/Checksum.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/org/traccar/helper/Checksum.java b/src/org/traccar/helper/Checksum.java
index f08292392..43ba6a689 100644
--- a/src/org/traccar/helper/Checksum.java
+++ b/src/org/traccar/helper/Checksum.java
@@ -131,6 +131,7 @@ public final class Checksum {
// More info: http://reveng.sourceforge.net/crc-catalogue/16.htm
public static final String CRC16_IBM = "IBM";
+ public static final String CRC16_MODBUS = "MODBUS";
public static final String CRC16_X25 = "X-25";
public static final String CRC16_CCITT_FALSE = "CCITT-FALSE";
public static final String CRC16_KERMIT = "KERMIT";
@@ -159,6 +160,8 @@ public final class Checksum {
switch (type) {
case CRC16_IBM:
return crc16Reflected(buf, 0, CRC16_IBM_TABLE);
+ case CRC16_MODBUS:
+ return crc16Reflected(buf, 0xFFFF, CRC16_IBM_TABLE);
case CRC16_X25:
return crc16Reflected(buf, 0xFFFF, CRC16_CCITT_TABLE_REVERSE) ^ 0xFFFF;
case CRC16_CCITT_FALSE: