aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-07-19 04:09:19 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2017-07-19 04:09:19 +1200
commit73fb44dfb7dea5cdddcb3ab939e9b7a64ae49abb (patch)
treeea6b333669924af0c1c5f46564069bf1c19e871c
parentaa921d5acca68b92f0200183eb1c4a786a5f4882 (diff)
downloadtrackermap-server-73fb44dfb7dea5cdddcb3ab939e9b7a64ae49abb.tar.gz
trackermap-server-73fb44dfb7dea5cdddcb3ab939e9b7a64ae49abb.tar.bz2
trackermap-server-73fb44dfb7dea5cdddcb3ab939e9b7a64ae49abb.zip
Support Sinocastel version 3 protocol
-rw-r--r--src/org/traccar/protocol/CastelProtocolDecoder.java2
-rw-r--r--test/org/traccar/protocol/CastelProtocolDecoderTest.java3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/CastelProtocolDecoder.java b/src/org/traccar/protocol/CastelProtocolDecoder.java
index 83664fa5a..3a0ccea78 100644
--- a/src/org/traccar/protocol/CastelProtocolDecoder.java
+++ b/src/org/traccar/protocol/CastelProtocolDecoder.java
@@ -440,7 +440,7 @@ public class CastelProtocolDecoder extends BaseProtocolDecoder {
}
- } else if (version == 4) {
+ } else if (version == 3 || version == 4) {
return decodeSc(channel, remoteAddress, buf, version, id, type, deviceSession);
diff --git a/test/org/traccar/protocol/CastelProtocolDecoderTest.java b/test/org/traccar/protocol/CastelProtocolDecoderTest.java
index bbc5f1f37..6b52373e1 100644
--- a/test/org/traccar/protocol/CastelProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/CastelProtocolDecoderTest.java
@@ -12,6 +12,9 @@ public class CastelProtocolDecoderTest extends ProtocolTest {
CastelProtocolDecoder decoder = new CastelProtocolDecoder(new CastelProtocol());
+ verifyPositions(decoder, binary(ByteOrder.LITTLE_ENDIAN,
+ "40408200033231334c323031373030303131370000000000001001000c6759a10d67590a9e1200000000000e3e0000000000020000000e4e791c000004010d0711060515083017086cd1181f000040067d4944442d3231334c2056312e312e3120323031372d30352d3038004944442d3231334c2056312e312e3000000066e30d0a"));
+
verifyAttributes(decoder, binary(ByteOrder.LITTLE_ENDIAN,
"404043000432313345503230313630303035383500000000004006a2021d5810031d58ae940400da050000f6040000070000000400076401680000000001001bd20d0a"));