aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-12-09 05:41:37 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-12-09 05:41:37 +1300
commit47357e8b056d316c143df6d6cb8754f10cf2b5a6 (patch)
tree03dcd9415cf02a297208436c262525256bcd8f59 /src/org/traccar/protocol
parent7638564f34b182b3f9a4e650d3f180f04fe8ae28 (diff)
downloadtraccar-server-47357e8b056d316c143df6d6cb8754f10cf2b5a6.tar.gz
traccar-server-47357e8b056d316c143df6d6cb8754f10cf2b5a6.tar.bz2
traccar-server-47357e8b056d316c143df6d6cb8754f10cf2b5a6.zip
Fix AT2000 response (fix #2662)
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r--src/org/traccar/protocol/At2000ProtocolDecoder.java6
1 files 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);
}
}