diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-05-30 06:36:54 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-05-30 06:36:54 +1200 |
commit | 6d9874c9980cad42df8f4b4f1e47e7efbeb300b1 (patch) | |
tree | 20ad50fed56b0224f6d5c10e37270f320851b7f9 /src/org | |
parent | e3bd8d28436195efe640c4214028566bc2643db1 (diff) | |
download | traccar-server-6d9874c9980cad42df8f4b4f1e47e7efbeb300b1.tar.gz traccar-server-6d9874c9980cad42df8f4b4f1e47e7efbeb300b1.tar.bz2 traccar-server-6d9874c9980cad42df8f4b4f1e47e7efbeb300b1.zip |
Fix AT05 2G response message
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/traccar/protocol/TotemProtocolDecoder.java | 5 |
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"); } |