From 03de8348981e36ffcc88196de79a679ec5d1d82d Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 15 Jul 2020 08:26:42 -0700 Subject: Decode missing parameters --- .../org/traccar/protocol/ItsProtocolDecoder.java | 27 +++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/main/java/org/traccar/protocol/ItsProtocolDecoder.java b/src/main/java/org/traccar/protocol/ItsProtocolDecoder.java index 1e0a4603c..f66669a98 100644 --- a/src/main/java/org/traccar/protocol/ItsProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/ItsProtocolDecoder.java @@ -67,9 +67,9 @@ public class ItsProtocolDecoder extends BaseProtocolDecoder { .number("(d+),") // satellites .groupBegin() .number("(d+.?d*),") // altitude - .number("d+.?d*,") // pdop - .number("d+.?d*,") // hdop - .expression("[^,]*,") // operator + .number("(d+.?d*),") // pdop + .number("(d+.?d*),") // hdop + .expression("([^,]+)?,") // operator .number("([01]),") // ignition .number("([01]),") // charging .number("(d+.?d*),") // power @@ -81,6 +81,15 @@ public class ItsProtocolDecoder extends BaseProtocolDecoder { .number("([01]{2}),") // outputs .groupBegin() .number("d+,") // index + .number("(d+.?d*),") // odometer + .number("(d+.?d*),") // adc1 + .number("(-?d+.?d*),") // acceleration x + .number("(-?d+.?d*),") // acceleration y + .number("(-?d+.?d*),") // acceleration z + .number("(-?d+),") // tilt y + .number("(-?d+),") // tilt x + .or() + .number("d+,") // index .number("(d+.?d*),") // adc1 .number("(d+.?d*),") // adc2 .groupEnd("?") @@ -188,6 +197,9 @@ public class ItsProtocolDecoder extends BaseProtocolDecoder { if (parser.hasNext(8)) { position.setAltitude(parser.nextDouble()); + position.set(Position.KEY_PDOP, parser.nextDouble()); + position.set(Position.KEY_HDOP, parser.nextDouble()); + position.set(Position.KEY_OPERATOR, parser.next()); position.set(Position.KEY_IGNITION, parser.nextInt() > 0); position.set(Position.KEY_CHARGE, parser.nextInt() > 0); position.set(Position.KEY_POWER, parser.nextDouble()); @@ -223,6 +235,15 @@ public class ItsProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_OUTPUT, parser.nextBinInt()); } + if (parser.hasNext(7)) { + position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1000); + position.set(Position.PREFIX_ADC + 1, parser.nextDouble()); + position.set(Position.KEY_G_SENSOR, + "[" + parser.nextDouble() + "," + parser.nextDouble() + "," + parser.nextDouble() + "]"); + position.set("tiltY", parser.nextInt()); + position.set("tiltX", parser.nextInt()); + } + if (parser.hasNext(2)) { position.set(Position.PREFIX_ADC + 1, parser.nextDouble()); position.set(Position.PREFIX_ADC + 2, parser.nextDouble()); -- cgit v1.2.3