aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r--src/main/java/org/traccar/protocol/SnapperProtocolDecoder.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/protocol/SnapperProtocolDecoder.java b/src/main/java/org/traccar/protocol/SnapperProtocolDecoder.java
index 5e513d954..25cc1a431 100644
--- a/src/main/java/org/traccar/protocol/SnapperProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/SnapperProtocolDecoder.java
@@ -66,13 +66,13 @@ public class SnapperProtocolDecoder extends BaseProtocolDecoder {
ByteBuf response = Unpooled.buffer();
response.writeByte('K');
response.writeByte(3); // protocol version
- response.writeIntLE(0); // reserved
- response.writeIntLE(0); // reserved
+ response.writeLongLE(0); // reserved
response.writeShortLE(0); // encryption
+ response.writeIntLE(0); // reserved
response.writeIntLE(answer.length());
response.writeShortLE(index);
response.writeByte(Checksum.sum(ByteBuffer.wrap(answer.getBytes(StandardCharsets.US_ASCII))));
- response.writeByte(type);
+ response.writeShortLE(type);
response.writeCharSequence(answer, StandardCharsets.US_ASCII);
channel.writeAndFlush(new NetworkMessage(response, remoteAddress));
}