diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/traccar/protocol/ItsProtocolDecoder.java | 27 |
1 files changed, 24 insertions, 3 deletions
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()); |