diff options
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"); } |