aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-12-17 10:01:10 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-12-17 10:01:10 +1300
commite61fb62eba34e337f748eb18ce93bb3d3035e275 (patch)
tree6a49ca2cfefd3d2c5a354fabe28241dacbacf9c5
parent1253934d826bd64e12fd0a40cc283f89006b2509 (diff)
downloadtraccar-server-e61fb62eba34e337f748eb18ce93bb3d3035e275.tar.gz
traccar-server-e61fb62eba34e337f748eb18ce93bb3d3035e275.tar.bz2
traccar-server-e61fb62eba34e337f748eb18ce93bb3d3035e275.zip
Fix Noran new position decoding (fix #1595)
-rw-r--r--src/org/traccar/protocol/NoranProtocolDecoder.java3
-rw-r--r--test/org/traccar/protocol/NoranProtocolDecoderTest.java11
2 files changed, 8 insertions, 6 deletions
diff --git a/src/org/traccar/protocol/NoranProtocolDecoder.java b/src/org/traccar/protocol/NoranProtocolDecoder.java
index 35924c5b2..1900ab33f 100644
--- a/src/org/traccar/protocol/NoranProtocolDecoder.java
+++ b/src/org/traccar/protocol/NoranProtocolDecoder.java
@@ -74,8 +74,7 @@ public class NoranProtocolDecoder extends BaseProtocolDecoder {
boolean newFormat = false;
if (type == MSG_UPLOAD_POSITION && buf.readableBytes() == 48
|| type == MSG_ALARM && buf.readableBytes() == 48
- || type == MSG_CONTROL_RESPONSE && buf.readableBytes() == 57
- || type == MSG_UPLOAD_POSITION_NEW) {
+ || type == MSG_CONTROL_RESPONSE && buf.readableBytes() == 57) {
newFormat = true;
}
diff --git a/test/org/traccar/protocol/NoranProtocolDecoderTest.java b/test/org/traccar/protocol/NoranProtocolDecoderTest.java
index de3a6c24f..abe21c68e 100644
--- a/test/org/traccar/protocol/NoranProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/NoranProtocolDecoderTest.java
@@ -11,10 +11,13 @@ public class NoranProtocolDecoderTest extends ProtocolTest {
public void testDecode() throws Exception {
NoranProtocolDecoder decoder = new NoranProtocolDecoder(new NoranProtocol());
-
- //verifyPosition(decoder, binary(ByteOrder.LITTLE_ENDIAN,
- // "28003200c38000d900fcc97a416b1a7a42b43eef3d4e523039473034383737000000000092fcda4a"));
-
+
+ verifyPosition(decoder, binary(ByteOrder.LITTLE_ENDIAN,
+ "28003200c380000000469458408c4ad340ad381e3f4e52303947313336303900000001ff00002041"));
+
+ verifyPosition(decoder, binary(ByteOrder.LITTLE_ENDIAN,
+ "28003200c38000d900fcc97a416b1a7a42b43eef3d4e523039473034383737000000000092fcda4a"));
+
verifyPosition(decoder, binary(ByteOrder.LITTLE_ENDIAN,
"3400080001090000000000001D43A29BE842E62520424E523039423036363932000031322D30332D30352031313A34373A343300"));