diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-03-27 21:12:01 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-03-27 21:12:01 +1300 |
commit | bf35aec0e38a9c5b30a41a0d9dcf904320f244ca (patch) | |
tree | 5c5a80ee6208b7fae67fb108582cb8b8a517465e /src/org/traccar | |
parent | b9b2217b2acd3d3e0a202ea0be59bb88e45a4da8 (diff) | |
download | trackermap-server-bf35aec0e38a9c5b30a41a0d9dcf904320f244ca.tar.gz trackermap-server-bf35aec0e38a9c5b30a41a0d9dcf904320f244ca.tar.bz2 trackermap-server-bf35aec0e38a9c5b30a41a0d9dcf904320f244ca.zip |
Fix RoboTrack acknowledgement response
Diffstat (limited to 'src/org/traccar')
-rw-r--r-- | src/org/traccar/protocol/RoboTrackProtocolDecoder.java | 7 |
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); } |