aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-08-06 10:24:53 +0300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-08-06 10:24:53 +0300
commit08e058e868566e44a8e955fa8d18bdae5630ecec (patch)
tree03f4ea94e83c98fda005b74c209fb642a7806347
parent2cc642af2b1aeeb07e2b6676cf433112cc7cd7bc (diff)
downloadtrackermap-server-08e058e868566e44a8e955fa8d18bdae5630ecec.tar.gz
trackermap-server-08e058e868566e44a8e955fa8d18bdae5630ecec.tar.bz2
trackermap-server-08e058e868566e44a8e955fa8d18bdae5630ecec.zip
Fix an issue in Castel decoder
-rw-r--r--src/org/traccar/protocol/CastelProtocolDecoder.java8
-rw-r--r--test/org/traccar/protocol/CastelProtocolDecoderTest.java3
2 files changed, 10 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/CastelProtocolDecoder.java b/src/org/traccar/protocol/CastelProtocolDecoder.java
index 212096018..0beca4070 100644
--- a/src/org/traccar/protocol/CastelProtocolDecoder.java
+++ b/src/org/traccar/protocol/CastelProtocolDecoder.java
@@ -218,7 +218,13 @@ public class CastelProtocolDecoder extends BaseProtocolDecoder {
return positions;
}
- } else if (type == MSG_SC_GPS_SLEEP || type == MSG_SC_AGPS_REQUEST) {
+ } else if (type == MSG_SC_GPS_SLEEP) {
+
+ buf.readUnsignedInt(); // device time
+
+ return readPosition(deviceSession, buf);
+
+ } else if (type == MSG_SC_AGPS_REQUEST) {
return readPosition(deviceSession, buf);
diff --git a/test/org/traccar/protocol/CastelProtocolDecoderTest.java b/test/org/traccar/protocol/CastelProtocolDecoderTest.java
index 6df2fd387..feba9386e 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());
+ verifyPosition(decoder, binary(ByteOrder.LITTLE_ENDIAN,
+ "40403600043231334e583230313630303033343600000000004009ad31a457050810061a35b29bf80ae6da83180300320bbe32580d0a40403600043231334e583230313630303033343600000000004009ad31a457050810061a35b29bf80ae6da83180300320bbe32580d0a"));
+
verifyNothing(decoder, binary(ByteOrder.LITTLE_ENDIAN,
"4040d400043535333133350000000000000000000000000000100196d499574bd899570000000000000000010000000000000000000000002410000000004944445f3231334730325f532056322e332e345f4e004944445f3231334730325f482056322e332e345f4e0032000110021003100410051006100710081009100a100b100c100d100e1011100111021103110411051106110711011202120312041201130213031301160216011701180218011b011c011d011e011f021f031f041f051f061f071f012102210126012701285b410d0a"));