aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-03-20 22:32:15 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2019-03-20 22:32:15 -0700
commit1816dcd505d0d5d8201ce2e8f78030569e70322f (patch)
treed9f914b5b100004f3cfc6f2cad5b170fb7326267
parent0be9e4a11b3c288b8d6aa6a53c23623684e27e1f (diff)
downloadtrackermap-server-1816dcd505d0d5d8201ce2e8f78030569e70322f.tar.gz
trackermap-server-1816dcd505d0d5d8201ce2e8f78030569e70322f.tar.bz2
trackermap-server-1816dcd505d0d5d8201ce2e8f78030569e70322f.zip
Decode T800x satellites
-rw-r--r--src/org/traccar/protocol/T800xProtocolDecoder.java3
-rw-r--r--test/org/traccar/protocol/T800xProtocolDecoderTest.java3
2 files changed, 5 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/T800xProtocolDecoder.java b/src/org/traccar/protocol/T800xProtocolDecoder.java
index 866971090..9db5b22f0 100644
--- a/src/org/traccar/protocol/T800xProtocolDecoder.java
+++ b/src/org/traccar/protocol/T800xProtocolDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2015 - 2018 Anton Tananaev (anton@traccar.org)
+ * Copyright 2015 - 2019 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -112,6 +112,7 @@ public class T800xProtocolDecoder extends BaseProtocolDecoder {
buf.readUnsignedShort(); // speed alarm
int status = buf.readUnsignedByte();
+ position.set(Position.KEY_SATELLITES, BitUtil.to(status, 5));
buf.readUnsignedByte(); // gsensor manager status
buf.readUnsignedByte(); // other flags
diff --git a/test/org/traccar/protocol/T800xProtocolDecoderTest.java b/test/org/traccar/protocol/T800xProtocolDecoderTest.java
index aa74ec417..fe77d91b7 100644
--- a/test/org/traccar/protocol/T800xProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/T800xProtocolDecoderTest.java
@@ -14,6 +14,9 @@ public class T800xProtocolDecoderTest extends ProtocolTest {
"252501001504050880061689888888111111250350"));
verifyPosition(decoder, binary(
+ "2525020044a66d0862522030401350001403841409c40064edc000051100960000071701370000003ea7ee0019032010581300000000aad3e1bda6f24d42000000001281"));
+
+ verifyPosition(decoder, binary(
"252502004400010880616898888888000A00FF2001000020409600989910101010055501550000101005050005051010050558866B4276D6E342912AB441111500051010"));
verifyNull(decoder, binary(