aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-05-27 17:58:52 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2019-05-27 17:58:52 -0700
commit5a35cad42efb1298ff679acf80cbbce169cc4646 (patch)
tree5238de7c9b0cd35057e492c31ce1bfe14b17095d /src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java
parent961015781071a240c2e4f9c7c5a33a4bfaafd168 (diff)
downloadtraccar-server-5a35cad42efb1298ff679acf80cbbce169cc4646.tar.gz
traccar-server-5a35cad42efb1298ff679acf80cbbce169cc4646.tar.bz2
traccar-server-5a35cad42efb1298ff679acf80cbbce169cc4646.zip
Update acknowledgement message
Diffstat (limited to 'src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java
index 51b32ae3e..14f32a3ec 100644
--- a/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Minifinder2ProtocolDecoder.java
@@ -72,8 +72,13 @@ public class Minifinder2ProtocolDecoder extends BaseProtocolDecoder {
ByteBuf buf = (ByteBuf) msg;
buf.readUnsignedByte(); // header
+ int flags = buf.readUnsignedByte();
+ buf.readUnsignedShortLE(); // length
+ buf.readUnsignedShortLE(); // checksum
+ int index = buf.readUnsignedShortLE();
+ int type = buf.readUnsignedByte();
- if (BitUtil.check(buf.readUnsignedByte(), 4) && channel != null) {
+ if (BitUtil.check(flags, 4) && channel != null) {
ByteBuf content = Unpooled.buffer();
content.writeByte(MSG_RESPONSE);
@@ -82,21 +87,16 @@ public class Minifinder2ProtocolDecoder extends BaseProtocolDecoder {
ByteBuf response = Unpooled.buffer();
response.writeByte(0xAB); // header
- response.writeByte(0); // properties
- response.writeShortLE(3);
+ response.writeByte(0x28); // properties
+ response.writeShortLE(content.readableBytes());
response.writeShortLE(Checksum.crc16(Checksum.CRC16_XMODEM, content.nioBuffer()));
- response.writeShortLE(0); // index
+ response.writeShortLE(index);
response.writeBytes(content);
content.release();
channel.writeAndFlush(new NetworkMessage(response, remoteAddress));
}
- buf.readUnsignedShortLE(); // length
- buf.readUnsignedShortLE(); // checksum
- buf.readUnsignedShortLE(); // index
- int type = buf.readUnsignedByte();
-
if (type == MSG_DATA) {
Position position = new Position(getProtocolName());