From 7aa230b9ddcd5540e7ff9c9b3d9bcf5119175c46 Mon Sep 17 00:00:00 2001 From: Stefan Clark Date: Sat, 17 Sep 2022 20:46:40 +0100 Subject: Xexun2 Encoder update --- src/main/java/org/traccar/protocol/Xexun2ProtocolEncoder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/org/traccar/protocol') diff --git a/src/main/java/org/traccar/protocol/Xexun2ProtocolEncoder.java b/src/main/java/org/traccar/protocol/Xexun2ProtocolEncoder.java index c315cab30..8f3fa5672 100644 --- a/src/main/java/org/traccar/protocol/Xexun2ProtocolEncoder.java +++ b/src/main/java/org/traccar/protocol/Xexun2ProtocolEncoder.java @@ -40,7 +40,7 @@ public class Xexun2ProtocolEncoder extends BaseProtocolEncoder { buf.writeShort(Xexun2ProtocolDecoder.MSG_COMMAND); buf.writeShort(1); // index buf.writeBytes(DataConverter.parseHex(uniqueId + "0")); - buf.writeShort(message.capacity()); + buf.writeShort(message.readableBytes()); buf.writeShort(Checksum.ip(message.nioBuffer())); buf.writeBytes(message); buf.writeShort(Xexun2ProtocolDecoder.FLAG); -- cgit v1.2.3