diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2020-11-19 22:51:43 -0800 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2020-11-19 22:51:43 -0800 |
commit | 13801af75e4b8d2554f753b1d2cc1dafc89fd8c6 (patch) | |
tree | ea7122dc229fece0e56f793cd22c96b8192bcc64 /src/main/java | |
parent | edbb7fe3482aedc30318de739472d1a2240aef4e (diff) | |
download | trackermap-server-13801af75e4b8d2554f753b1d2cc1dafc89fd8c6.tar.gz trackermap-server-13801af75e4b8d2554f753b1d2cc1dafc89fd8c6.tar.bz2 trackermap-server-13801af75e4b8d2554f753b1d2cc1dafc89fd8c6.zip |
Fix message acknowledgement
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/traccar/protocol/TaipProtocolDecoder.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/TaipProtocolDecoder.java b/src/main/java/org/traccar/protocol/TaipProtocolDecoder.java index 285e68ddd..0878e65af 100644 --- a/src/main/java/org/traccar/protocol/TaipProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/TaipProtocolDecoder.java @@ -307,8 +307,13 @@ public class TaipProtocolDecoder extends BaseProtocolDecoder { if (deviceSession != null) { if (channel != null) { if (messageIndex != null) { - String response = ">ACK;ID=" + uniqueId + ";" + messageIndex + ";*"; - response += String.format("%02X", Checksum.xor(response)) + "<"; + String response; + if (messageIndex.startsWith("#IP:")) { + response = ">SAK;ID=" + uniqueId + ";" + messageIndex + "<"; + } else { + response = ">ACK;ID=" + uniqueId + ";" + messageIndex + ";*"; + response += String.format("%02X", Checksum.xor(response)) + "<"; + } channel.writeAndFlush(new NetworkMessage(response, remoteAddress)); } else { channel.writeAndFlush(new NetworkMessage(uniqueId, remoteAddress)); |