From 8e41d3c5eb9d7bfe288ef950b4ac3e4c33c6f1e7 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 9 Dec 2020 20:03:20 -0800 Subject: Fix decoding --- .../java/org/traccar/protocol/MobilogixProtocolDecoder.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/main') 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())); -- cgit v1.2.3