aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-03-27 21:12:01 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2018-03-27 21:12:01 +1300
commitbf35aec0e38a9c5b30a41a0d9dcf904320f244ca (patch)
tree5c5a80ee6208b7fae67fb108582cb8b8a517465e /src/org/traccar/protocol
parentb9b2217b2acd3d3e0a202ea0be59bb88e45a4da8 (diff)
downloadtraccar-server-bf35aec0e38a9c5b30a41a0d9dcf904320f244ca.tar.gz
traccar-server-bf35aec0e38a9c5b30a41a0d9dcf904320f244ca.tar.bz2
traccar-server-bf35aec0e38a9c5b30a41a0d9dcf904320f244ca.zip
Fix RoboTrack acknowledgement response
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r--src/org/traccar/protocol/RoboTrackProtocolDecoder.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/RoboTrackProtocolDecoder.java b/src/org/traccar/protocol/RoboTrackProtocolDecoder.java
index 2244ea716..323928116 100644
--- a/src/org/traccar/protocol/RoboTrackProtocolDecoder.java
+++ b/src/org/traccar/protocol/RoboTrackProtocolDecoder.java
@@ -28,6 +28,7 @@ import org.traccar.model.Network;
import org.traccar.model.Position;
import java.net.SocketAddress;
+import java.nio.ByteOrder;
import java.nio.charset.StandardCharsets;
import java.util.Date;
@@ -60,9 +61,9 @@ public class RoboTrackProtocolDecoder extends BaseProtocolDecoder {
String imei = buf.readBytes(15).toString(StandardCharsets.US_ASCII);
if (getDeviceSession(channel, remoteAddress, imei) != null && channel != null) {
- ChannelBuffer response = ChannelBuffers.dynamicBuffer();
- buf.writeByte(MSG_ACK);
- buf.writeByte(0x01); // success
+ ChannelBuffer response = ChannelBuffers.dynamicBuffer(ByteOrder.LITTLE_ENDIAN, 0);
+ response.writeByte(MSG_ACK);
+ response.writeByte(0x01); // success
response.writeByte(Checksum.crc8(Checksum.CRC8_ROHC, response.toByteBuffer()));
channel.write(response);
}