From bf35aec0e38a9c5b30a41a0d9dcf904320f244ca Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 27 Mar 2018 21:12:01 +1300 Subject: Fix RoboTrack acknowledgement response --- src/org/traccar/protocol/RoboTrackProtocolDecoder.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') 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); } -- cgit v1.2.3