From 47357e8b056d316c143df6d6cb8754f10cf2b5a6 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 9 Dec 2016 05:41:37 +1300 Subject: Fix AT2000 response (fix #2662) --- src/org/traccar/protocol/At2000ProtocolDecoder.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/org/traccar/protocol/At2000ProtocolDecoder.java b/src/org/traccar/protocol/At2000ProtocolDecoder.java index f1399b731..e9c26d406 100644 --- a/src/org/traccar/protocol/At2000ProtocolDecoder.java +++ b/src/org/traccar/protocol/At2000ProtocolDecoder.java @@ -50,11 +50,11 @@ public class At2000ProtocolDecoder extends BaseProtocolDecoder { private static void sendResponse(Channel channel) { if (channel != null) { - ChannelBuffer response = ChannelBuffers.directBuffer(ByteOrder.LITTLE_ENDIAN, BLOCK_LENGTH); + ChannelBuffer response = ChannelBuffers.directBuffer(ByteOrder.LITTLE_ENDIAN, 2 * BLOCK_LENGTH); response.writeByte(MSG_ACKNOWLEDGEMENT); - response.writeMedium(1); + response.writeMedium(ChannelBuffers.swapMedium(1)); response.writeByte(0x00); // success - response.writerIndex(BLOCK_LENGTH); + response.writerIndex(2 * BLOCK_LENGTH); channel.write(response); } } -- cgit v1.2.3