aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-06-02 22:08:28 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2021-06-02 22:08:28 -0700
commit60467dccc46dfdd3b32b342ead40652774f96451 (patch)
tree16ef74a438551720bd1c48be20262572a9e07dd8 /src/main/java/org/traccar
parent53b65b11f31e53c6d612aa56ebe94d29d649f934 (diff)
downloadtrackermap-server-60467dccc46dfdd3b32b342ead40652774f96451.tar.gz
trackermap-server-60467dccc46dfdd3b32b342ead40652774f96451.tar.bz2
trackermap-server-60467dccc46dfdd3b32b342ead40652774f96451.zip
Fix TAIP response
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r--src/main/java/org/traccar/protocol/TaipPrefixEncoder.java4
-rw-r--r--src/main/java/org/traccar/protocol/TaipProtocolDecoder.java2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/protocol/TaipPrefixEncoder.java b/src/main/java/org/traccar/protocol/TaipPrefixEncoder.java
index 3d906ab60..02c111b01 100644
--- a/src/main/java/org/traccar/protocol/TaipPrefixEncoder.java
+++ b/src/main/java/org/traccar/protocol/TaipPrefixEncoder.java
@@ -38,9 +38,9 @@ public class TaipPrefixEncoder extends MessageToMessageEncoder<ByteBuf> {
@Override
protected void encode(ChannelHandlerContext ctx, ByteBuf msg, List<Object> out) throws Exception {
if (Context.getConfig().getBoolean(Keys.PROTOCOL_PREFIX.withPrefix(protocol.getName()))) {
- out.add(Unpooled.wrappedBuffer(Unpooled.wrappedBuffer(new byte[] {0x20, 0x20, 0x06, 0x00}), msg));
+ out.add(Unpooled.wrappedBuffer(Unpooled.wrappedBuffer(new byte[] {0x20, 0x20, 0x06, 0x00}), msg.retain()));
} else {
- out.add(msg);
+ out.add(msg.retain());
}
}
diff --git a/src/main/java/org/traccar/protocol/TaipProtocolDecoder.java b/src/main/java/org/traccar/protocol/TaipProtocolDecoder.java
index 6f71b6c08..ec0ce1931 100644
--- a/src/main/java/org/traccar/protocol/TaipProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/TaipProtocolDecoder.java
@@ -313,7 +313,7 @@ public class TaipProtocolDecoder extends BaseProtocolDecoder {
if (messageIndex != null) {
String response;
if (messageIndex.startsWith("#IP")) {
- response = "\u0020\u0020\u0006\u0000>SAK;ID=" + uniqueId + ";" + messageIndex + "<";
+ response = ">SAK;ID=" + uniqueId + ";" + messageIndex + "<";
} else {
response = ">ACK;ID=" + uniqueId + ";" + messageIndex + ";*";
response += String.format("%02X", Checksum.xor(response)) + "<";