From 1423209d00804948110e1b70c2e41248b4945877 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 4 Mar 2017 13:28:03 +1300 Subject: Ensure that odometer is a number (fix #2967) --- src/org/traccar/protocol/AquilaProtocolDecoder.java | 2 +- src/org/traccar/protocol/MeitrackProtocolDecoder.java | 2 +- src/org/traccar/protocol/TotemProtocolDecoder.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/org/traccar/protocol') diff --git a/src/org/traccar/protocol/AquilaProtocolDecoder.java b/src/org/traccar/protocol/AquilaProtocolDecoder.java index e1cebd20d..11ab15c86 100644 --- a/src/org/traccar/protocol/AquilaProtocolDecoder.java +++ b/src/org/traccar/protocol/AquilaProtocolDecoder.java @@ -132,7 +132,7 @@ public class AquilaProtocolDecoder extends BaseProtocolDecoder { position.setSpeed(UnitsConverter.knotsFromKph(parser.nextDouble())); - position.set(Position.KEY_ODOMETER, parser.next()); + position.set(Position.KEY_ODOMETER, parser.nextInt()); if (parser.hasNext(9)) { diff --git a/src/org/traccar/protocol/MeitrackProtocolDecoder.java b/src/org/traccar/protocol/MeitrackProtocolDecoder.java index 4862b4937..f5253566b 100644 --- a/src/org/traccar/protocol/MeitrackProtocolDecoder.java +++ b/src/org/traccar/protocol/MeitrackProtocolDecoder.java @@ -124,7 +124,7 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder { position.setAltitude(parser.nextDouble()); - position.set(Position.KEY_ODOMETER, parser.next()); + position.set(Position.KEY_ODOMETER, parser.nextInt()); position.set("runtime", parser.next()); position.setNetwork(new Network( diff --git a/src/org/traccar/protocol/TotemProtocolDecoder.java b/src/org/traccar/protocol/TotemProtocolDecoder.java index 6a4b2052c..f36ef8143 100644 --- a/src/org/traccar/protocol/TotemProtocolDecoder.java +++ b/src/org/traccar/protocol/TotemProtocolDecoder.java @@ -290,7 +290,7 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder { position.setCourse(parser.nextDouble()); position.setSpeed(parser.nextDouble()); position.set("pdop", parser.next()); - position.set(Position.KEY_ODOMETER, parser.next()); + position.set(Position.KEY_ODOMETER, parser.nextInt() * 1000); position.setLatitude(parser.nextCoordinate()); position.setLongitude(parser.nextCoordinate()); -- cgit v1.2.3