From 771768c215d31e6b9e4a50079cabdbd96fc62d5f Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 5 Nov 2019 22:33:27 -0800 Subject: Update Plugin protocol --- src/main/java/org/traccar/protocol/PluginProtocolDecoder.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main') diff --git a/src/main/java/org/traccar/protocol/PluginProtocolDecoder.java b/src/main/java/org/traccar/protocol/PluginProtocolDecoder.java index 106889ee0..b5d71854b 100644 --- a/src/main/java/org/traccar/protocol/PluginProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/PluginProtocolDecoder.java @@ -40,12 +40,12 @@ public class PluginProtocolDecoder extends BaseProtocolDecoder { .number("(dd)(dd)(dd),") // time (hhmmss) .number("(-?d+.d+),") // longitude .number("(-?d+.d+),") // latitude - .number("(d+),") // speed + .number("(d+.?d*),") // speed .number("(d+),") // course .number("(-?d+),") // altitude .number("(-?d+),") // satellites .number("d+,") // type - .number("(d+),") // odometer + .number("(d+.?d*),") // odometer .number("(d+),") // status .expression("[^,]*,") .expression("[^,]*,") @@ -78,12 +78,12 @@ public class PluginProtocolDecoder extends BaseProtocolDecoder { position.setTime(parser.nextDateTime()); position.setLongitude(parser.nextDouble()); position.setLatitude(parser.nextDouble()); - position.setSpeed(UnitsConverter.knotsFromKph(parser.nextInt())); + position.setSpeed(UnitsConverter.knotsFromKph(parser.nextDouble())); position.setCourse(parser.nextInt()); position.setAltitude(parser.nextInt()); position.set(Position.KEY_SATELLITES, parser.nextInt()); - position.set(Position.KEY_ODOMETER, parser.nextInt()); + position.set(Position.KEY_ODOMETER, (long) (parser.nextDouble() * 1000)); position.set(Position.KEY_STATUS, parser.nextInt()); position.set(Position.KEY_EVENT, parser.nextInt()); -- cgit v1.2.3