aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/org/traccar/protocol/NavigilProtocolDecoder.java2
-rw-r--r--test/org/traccar/protocol/NavigilProtocolDecoderTest.java7
2 files changed, 6 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/NavigilProtocolDecoder.java b/src/org/traccar/protocol/NavigilProtocolDecoder.java
index 3e116486f..58ea6e577 100644
--- a/src/org/traccar/protocol/NavigilProtocolDecoder.java
+++ b/src/org/traccar/protocol/NavigilProtocolDecoder.java
@@ -63,7 +63,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
data.writeShort(0); // OK
ChannelBuffer header = ChannelBuffers.directBuffer(ByteOrder.LITTLE_ENDIAN, 20);
- header.writeByte(1); header.writeByte(1);
+ header.writeByte(1); header.writeByte(0);
header.writeShort(senderSequenceNumber++);
header.writeShort(MESSAGE_ACKNOWLEDGEMENT);
header.writeShort(header.capacity() + data.capacity());
diff --git a/test/org/traccar/protocol/NavigilProtocolDecoderTest.java b/test/org/traccar/protocol/NavigilProtocolDecoderTest.java
index 100e178d8..289018951 100644
--- a/test/org/traccar/protocol/NavigilProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/NavigilProtocolDecoderTest.java
@@ -14,8 +14,11 @@ public class NavigilProtocolDecoderTest {
NavigilProtocolDecoder decoder = new NavigilProtocolDecoder(null);
decoder.setDataManager(new TestDataManager());
- //byte[] buf1 = {0x40,0x4E,0x54,0x43,0x01,0x00,0x00,0x00,0x7B,0x00,0x00,0x00,0x13,0x00,0x44,0x34,0x2A,0x3E,0x53,0x3A,0x38,0x36,0x31,0x37,0x38,0x35,0x30,0x30,0x35,0x32,0x30,0x35,0x30,0x37,0x39};
- //assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, buf1)));
+ byte[] buf1 = {0x01,0x00,0x43,0x00,0x04,0x00,0x20,0x00,0x00,0x00,(byte)0xf6,0x02,0x03,0x08,0x02,0x00,(byte)0xe7,(byte)0xcd,0x0f,0x51,0x0c,0x00,0x00,0x00,0x3b,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
+ assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, buf1)));
+
+ byte[] buf2 = {0x01,0x00,(byte)0xb3,0x00,0x0f,0x00,0x24,0x00,0x00,0x00,(byte)0xf4,(byte)0xa8,0x03,0x08,0x02,0x00,(byte)0xca,0x0c,0x11,0x51,(byte)0xef,(byte)0x88,(byte)0x85,(byte)0xf0,(byte)0xb8,0x2e,0x6d,0x13,0x04,0x00,(byte)0xc0,0x04,0x03,0x00,0x00,0x00};
+ assertNotNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, buf2)));
}