aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-06-27 22:39:23 -0700
committerAnton Tananaev <anton@traccar.org>2023-06-27 22:39:23 -0700
commit1b899329364619cbdc4213e2fd065955a94f5c6c (patch)
tree57394f0898768df6a361b4a435bdecdb4417a780 /src
parent3b6900a95342ae87861cfcae8870ac790da7a504 (diff)
downloadtrackermap-server-1b899329364619cbdc4213e2fd065955a94f5c6c.tar.gz
trackermap-server-1b899329364619cbdc4213e2fd065955a94f5c6c.tar.bz2
trackermap-server-1b899329364619cbdc4213e2fd065955a94f5c6c.zip
Fix Fifotrack Q2 decoding
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java2
-rw-r--r--src/test/java/org/traccar/protocol/FifotrackProtocolDecoderTest.java4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java b/src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java
index 14b33b67f..c30398d36 100644
--- a/src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java
@@ -235,8 +235,8 @@ public class FifotrackProtocolDecoder extends BaseProtocolDecoder {
position.setValid(parser.next().equals("A"));
position.setFixTime(position.getDeviceTime());
- position.set(Position.KEY_SATELLITES, parser.nextInt());
position.setSpeed(UnitsConverter.knotsFromKph(parser.nextInt()));
+ position.set(Position.KEY_SATELLITES, parser.nextInt());
position.setLatitude(parser.nextDouble());
position.setLongitude(parser.nextDouble());
diff --git a/src/test/java/org/traccar/protocol/FifotrackProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/FifotrackProtocolDecoderTest.java
index 518eada52..cbfc46703 100644
--- a/src/test/java/org/traccar/protocol/FifotrackProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/FifotrackProtocolDecoderTest.java
@@ -11,6 +11,10 @@ public class FifotrackProtocolDecoderTest extends ProtocolTest {
var decoder = inject(new FifotrackProtocolDecoder(null));
+ verifyAttribute(decoder, buffer(
+ "$$99,865413050150407,7F,A03,,230626072722,460|0|25FC|AC2AB0B,3.74,52,0019,0,A,0,13,22.643466,114.018211*74"),
+ Position.KEY_SATELLITES, 13);
+
verifyPosition(decoder, buffer(
"$$95,866104023192332,1,A03,,210414055249,460|0|25FC|104C,4.18,100,000F,0,A,2,9,22.643175,114.018150*75"));