diff options
Diffstat (limited to 'src/main/java/org')
-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)); |