diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2021-05-28 21:28:40 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2021-05-28 21:28:40 -0700 |
commit | 5e4b1f4b5dc38bf03a305aefaad5ba30e652d8b8 (patch) | |
tree | 40b05ecddfb559582287a17e70d0f5248dc31cc9 /src/main | |
parent | e8ef6067bafeb051aac6272a457d269684c4b8f3 (diff) | |
download | traccar-server-5e4b1f4b5dc38bf03a305aefaad5ba30e652d8b8.tar.gz traccar-server-5e4b1f4b5dc38bf03a305aefaad5ba30e652d8b8.tar.bz2 traccar-server-5e4b1f4b5dc38bf03a305aefaad5ba30e652d8b8.zip |
Ack response for all types
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java index 126656361..683ba476e 100644 --- a/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java @@ -1161,10 +1161,6 @@ public class Gl200TextProtocolDecoder extends BaseProtocolDecoder { decodeDeviceTime(position, parser); - if (channel != null && Context.getConfig().getBoolean(Keys.PROTOCOL_ACK.withPrefix(getProtocolName()))) { - channel.writeAndFlush(new NetworkMessage("+SACK:" + parser.next() + "$", remoteAddress)); - } - return position; } @@ -1329,6 +1325,16 @@ public class Gl200TextProtocolDecoder extends BaseProtocolDecoder { } } + if (channel != null && Context.getConfig().getBoolean(Keys.PROTOCOL_ACK.withPrefix(getProtocolName()))) { + String checksum; + if (sentence.endsWith("$")) { + checksum = sentence.substring(sentence.length() - 1 - 4, sentence.length() - 1); + } else { + checksum = sentence.substring(sentence.length() - 4); + } + channel.writeAndFlush(new NetworkMessage("+SACK:" + checksum + "$", remoteAddress)); + } + return result; } |