aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-05-30 06:36:54 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-05-30 06:36:54 +1200
commit6d9874c9980cad42df8f4b4f1e47e7efbeb300b1 (patch)
tree20ad50fed56b0224f6d5c10e37270f320851b7f9 /src/org/traccar/protocol
parente3bd8d28436195efe640c4214028566bc2643db1 (diff)
downloadtraccar-server-6d9874c9980cad42df8f4b4f1e47e7efbeb300b1.tar.gz
traccar-server-6d9874c9980cad42df8f4b4f1e47e7efbeb300b1.tar.bz2
traccar-server-6d9874c9980cad42df8f4b4f1e47e7efbeb300b1.zip
Fix AT05 2G response message
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r--src/org/traccar/protocol/TotemProtocolDecoder.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/TotemProtocolDecoder.java b/src/org/traccar/protocol/TotemProtocolDecoder.java
index d8943abd5..c200129d2 100644
--- a/src/org/traccar/protocol/TotemProtocolDecoder.java
+++ b/src/org/traccar/protocol/TotemProtocolDecoder.java
@@ -19,6 +19,7 @@ import org.jboss.netty.channel.Channel;
import org.traccar.BaseProtocolDecoder;
import org.traccar.DeviceSession;
import org.traccar.helper.BitUtil;
+import org.traccar.helper.Checksum;
import org.traccar.helper.DateBuilder;
import org.traccar.helper.Parser;
import org.traccar.helper.PatternBuilder;
@@ -408,7 +409,9 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder {
if (channel != null) {
if (pattern == PATTERN4) {
- channel.write("$$0014AA" + sentence.substring(sentence.length() - 6));
+ String response = "$$0014AA" + sentence.substring(sentence.length() - 6, sentence.length() - 2);
+ response += String.format("%02X", Checksum.xor(response)).toUpperCase();
+ channel.write(response);
} else {
channel.write("ACK OK\r\n");
}