aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r--src/org/traccar/protocol/AplicomProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/CityeasyProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/GpsGateProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/KhdProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/KhdProtocolEncoder.java2
-rw-r--r--src/org/traccar/protocol/LaipacProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/MeiligaoProtocolDecoder.java2
7 files changed, 7 insertions, 7 deletions
diff --git a/src/org/traccar/protocol/AplicomProtocolDecoder.java b/src/org/traccar/protocol/AplicomProtocolDecoder.java
index aa9dd57d1..c134a282e 100644
--- a/src/org/traccar/protocol/AplicomProtocolDecoder.java
+++ b/src/org/traccar/protocol/AplicomProtocolDecoder.java
@@ -40,7 +40,7 @@ public class AplicomProtocolDecoder extends BaseProtocolDecoder {
private static final long IMEI_BASE_TC65I_V11 = 0x14143B4000000L;
private static boolean validateImei(long imei) {
- return Checksum.luhnChecksum(imei / 10) == imei % 10;
+ return Checksum.luhn(imei / 10) == imei % 10;
}
private static long imeiFromUnitId(long unitId) {
diff --git a/src/org/traccar/protocol/CityeasyProtocolDecoder.java b/src/org/traccar/protocol/CityeasyProtocolDecoder.java
index 457ba9c5d..b08eb6c2d 100644
--- a/src/org/traccar/protocol/CityeasyProtocolDecoder.java
+++ b/src/org/traccar/protocol/CityeasyProtocolDecoder.java
@@ -72,7 +72,7 @@ public class CityeasyProtocolDecoder extends BaseProtocolDecoder {
String imei = ChannelBufferTools.readHexString(buf, 14);
if (!identify(imei, channel, null, false)) {
- if (!identify(imei + Checksum.luhnChecksum(Long.parseLong(imei)), channel)) {
+ if (!identify(imei + Checksum.luhn(Long.parseLong(imei)), channel)) {
return null;
}
}
diff --git a/src/org/traccar/protocol/GpsGateProtocolDecoder.java b/src/org/traccar/protocol/GpsGateProtocolDecoder.java
index 3994587bf..729a824cc 100644
--- a/src/org/traccar/protocol/GpsGateProtocolDecoder.java
+++ b/src/org/traccar/protocol/GpsGateProtocolDecoder.java
@@ -48,7 +48,7 @@ public class GpsGateProtocolDecoder extends BaseProtocolDecoder {
private void send(Channel channel, String message) {
if (channel != null) {
- channel.write(message + Checksum.nmeaChecksum(message) + "\r\n");
+ channel.write(message + Checksum.nmea(message) + "\r\n");
}
}
diff --git a/src/org/traccar/protocol/KhdProtocolDecoder.java b/src/org/traccar/protocol/KhdProtocolDecoder.java
index 3ad6761cd..9e3249a7a 100644
--- a/src/org/traccar/protocol/KhdProtocolDecoder.java
+++ b/src/org/traccar/protocol/KhdProtocolDecoder.java
@@ -136,7 +136,7 @@ public class KhdProtocolDecoder extends BaseProtocolDecoder {
response.writeByte(buf.readUnsignedByte());
response.writeByte(type);
response.writeByte(0); // reserved
- response.writeByte(Checksum.xorChecksum(response.toByteBuffer()));
+ response.writeByte(Checksum.xor(response.toByteBuffer()));
response.writeByte(0x0D); // ending
channel.write(response);
diff --git a/src/org/traccar/protocol/KhdProtocolEncoder.java b/src/org/traccar/protocol/KhdProtocolEncoder.java
index ca2407743..a33fa34c2 100644
--- a/src/org/traccar/protocol/KhdProtocolEncoder.java
+++ b/src/org/traccar/protocol/KhdProtocolEncoder.java
@@ -38,7 +38,7 @@ public class KhdProtocolEncoder extends BaseProtocolEncoder {
buf.writeInt(0); // terminal id
- buf.writeByte(Checksum.xorChecksum(buf.toByteBuffer()));
+ buf.writeByte(Checksum.xor(buf.toByteBuffer()));
buf.writeByte(0x0D); // ending
return buf;
diff --git a/src/org/traccar/protocol/LaipacProtocolDecoder.java b/src/org/traccar/protocol/LaipacProtocolDecoder.java
index 57dd797eb..825ec1eda 100644
--- a/src/org/traccar/protocol/LaipacProtocolDecoder.java
+++ b/src/org/traccar/protocol/LaipacProtocolDecoder.java
@@ -121,7 +121,7 @@ public class LaipacProtocolDecoder extends BaseProtocolDecoder {
if (type.equals("0") && Character.isLowerCase(status.charAt(0))) {
response = "$EAVACK,0," + checksum;
- response += Checksum.nmeaChecksum(response);
+ response += Checksum.nmea(response);
} else if (type.equals("S") || type.equals("T")) {
response = "$AVCFG,00000000,t*21";
} else if (type.equals("3")) {
diff --git a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
index 51587f3b5..bde28492f 100644
--- a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
+++ b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
@@ -100,7 +100,7 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder {
if (id.length() == 14) {
// Try to recreate full IMEI number
// Sometimes first digit is cut, so this won't work
- if (identify(id + Checksum.luhnChecksum(Long.valueOf(id)), channel, null, false)) {
+ if (identify(id + Checksum.luhn(Long.valueOf(id)), channel, null, false)) {
return true;
}
}