aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-12-09 20:03:20 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2020-12-09 20:03:20 -0800
commit8e41d3c5eb9d7bfe288ef950b4ac3e4c33c6f1e7 (patch)
treea5ca89c4a46e9a6bb8da7c8ae7abcc5386f3aa45 /src/main/java/org
parent207f6dbd254cef5f3b70f4725f1d5042d5726fd1 (diff)
downloadtraccar-server-8e41d3c5eb9d7bfe288ef950b4ac3e4c33c6f1e7.tar.gz
traccar-server-8e41d3c5eb9d7bfe288ef950b4ac3e4c33c6f1e7.tar.bz2
traccar-server-8e41d3c5eb9d7bfe288ef950b4ac3e4c33c6f1e7.zip
Fix decoding
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/traccar/protocol/MobilogixProtocolDecoder.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/protocol/MobilogixProtocolDecoder.java b/src/main/java/org/traccar/protocol/MobilogixProtocolDecoder.java
index edce2d52f..8677ba9ec 100644
--- a/src/main/java/org/traccar/protocol/MobilogixProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/MobilogixProtocolDecoder.java
@@ -45,10 +45,13 @@ public class MobilogixProtocolDecoder extends BaseProtocolDecoder {
.expression("([^,]+),") // serial number
.number("(xx),") // status
.number("(d+.d+),") // battery
+ .number("(d)") // valid
+ .number("(d)") // rssi
+ .number("(d),") // satellites
.number("(-?d+.d+),") // latitude
.number("(-?d+.d+),") // longitude
- .number("(d+.d+),") // speed
- .number("(d+.d+)") // course
+ .number("(d+.?d*),") // speed
+ .number("(d+.?d*)") // course
.any()
.compile();
@@ -92,7 +95,11 @@ public class MobilogixProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_BATTERY, parser.nextDouble());
- position.setValid(true);
+ position.setValid(parser.nextInt() > 0);
+
+ position.set(Position.KEY_RSSI, parser.nextInt());
+ position.set(Position.KEY_SATELLITES, parser.nextInt());
+
position.setLatitude(parser.nextDouble());
position.setLongitude(parser.nextDouble());
position.setSpeed(UnitsConverter.knotsFromKph(parser.nextDouble()));