aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/KhdProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-08-31 16:36:04 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-08-31 16:36:04 +1200
commit142734931830f117b0e86dfa5f6dddec5416d878 (patch)
treec549452fc812896789786a090c4f38983d048d10 /src/org/traccar/protocol/KhdProtocolDecoder.java
parent82872aacbbc0a1a0b7e76481055164b435422a50 (diff)
downloadtrackermap-server-142734931830f117b0e86dfa5f6dddec5416d878.tar.gz
trackermap-server-142734931830f117b0e86dfa5f6dddec5416d878.tar.bz2
trackermap-server-142734931830f117b0e86dfa5f6dddec5416d878.zip
Implement KHD protocol commands
Diffstat (limited to 'src/org/traccar/protocol/KhdProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/KhdProtocolDecoder.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/KhdProtocolDecoder.java b/src/org/traccar/protocol/KhdProtocolDecoder.java
index bff7568a7..f98f3e963 100644
--- a/src/org/traccar/protocol/KhdProtocolDecoder.java
+++ b/src/org/traccar/protocol/KhdProtocolDecoder.java
@@ -130,14 +130,14 @@ public class KhdProtocolDecoder extends BaseProtocolDecoder {
buf.skipBytes(4); // serial number
buf.readByte(); // reserved
- ChannelBuffer response = ChannelBuffers.directBuffer(10);
+ ChannelBuffer response = ChannelBuffers.dynamicBuffer();
response.writeByte(0x29); response.writeByte(0x29); // header
response.writeByte(MSG_CONFIRMATION);
response.writeShort(5); // size
response.writeByte(buf.readUnsignedByte());
response.writeByte(type);
response.writeByte(0); // reserved
- response.writeByte(Crc.xorChecksum(response.toByteBuffer(0, 8)));
+ response.writeByte(Crc.xorChecksum(response.toByteBuffer()));
response.writeByte(0x0D); // ending
channel.write(response);