diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-04-01 16:13:46 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-04-01 16:13:46 +1300 |
commit | 6a294a6f574c610e6577224c0eea0e65ce8993f2 (patch) | |
tree | 6736fc4c90b0bb651bce5a5720b0030d4c556bdf /src/org/traccar | |
parent | 571078422b3e1162870d777124a3844da56583b0 (diff) | |
download | traccar-server-6a294a6f574c610e6577224c0eea0e65ce8993f2.tar.gz traccar-server-6a294a6f574c610e6577224c0eea0e65ce8993f2.tar.bz2 traccar-server-6a294a6f574c610e6577224c0eea0e65ce8993f2.zip |
Add new Aquila protocol format
Diffstat (limited to 'src/org/traccar')
-rw-r--r-- | src/org/traccar/protocol/AquilaProtocolDecoder.java | 47 |
1 files changed, 44 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/AquilaProtocolDecoder.java b/src/org/traccar/protocol/AquilaProtocolDecoder.java index 56723e0ef..5f421727f 100644 --- a/src/org/traccar/protocol/AquilaProtocolDecoder.java +++ b/src/org/traccar/protocol/AquilaProtocolDecoder.java @@ -92,6 +92,33 @@ public class AquilaProtocolDecoder extends BaseProtocolDecoder { .number("-?d+,") // accelerometer y .number("-?d+,") // accelerometer z .number("d+,") // delta distance + .or() + .number("(d+),") // course + .number("(d+),") // satellites + .number("(d+.d+),") // hdop + .number("(?:d+,){2}") // reserved + .number("(d+),") // adc 1 + .number("([01]),") // di 1 + .number("[01],") // case open + .number("[01],") // over speed start + .number("[01],") // over speed end + .number("(?:[01],){2}") // reserved + .number("[01],") // immobilizer + .number("([01]),") // power status + .number("([01]),") // di 2 + .number("(?:[01],){2}") // reserved + .number("([01]),") // ignition + .number("(?:[01],){6}") // reserved + .number("[01],") // low battery + .number("[01],") // corner packet + .number("(?:[01],){4}") // reserved + .number("[01],") // do 1 + .number("[01],") // reserved + .number("[01],") // hard acceleration + .number("[01],") // hard breaking + .number("(?:[01],){4}") // reserved + .number("(d+),") // external voltage + .number("(d+),") // internal voltage .groupEnd() .text("*") .number("xx") // checksum @@ -133,9 +160,9 @@ public class AquilaProtocolDecoder extends BaseProtocolDecoder { if (parser.hasNext(9)) { position.set(Position.KEY_FUEL_LEVEL, parser.next()); - position.set(Position.PREFIX_IO + 1, parser.next()); + position.set(Position.PREFIX_IN + 1, parser.next()); position.set(Position.KEY_CHARGE, parser.next()); - position.set(Position.PREFIX_IO + 2, parser.next()); + position.set(Position.PREFIX_IN + 2, parser.next()); position.set(Position.KEY_IGNITION, parser.nextInt() == 1); @@ -144,7 +171,7 @@ public class AquilaProtocolDecoder extends BaseProtocolDecoder { position.setCourse((course - 1) * 45); } - } else { + } else if (parser.hasNext(7)) { position.setCourse(parser.nextInt()); @@ -159,6 +186,20 @@ public class AquilaProtocolDecoder extends BaseProtocolDecoder { String dtcs = parser.next(); position.set(Position.KEY_DTCS, dtcs.substring(1, dtcs.length() - 1).replace('|', ' ')); + } else { + + position.setCourse(parser.nextInt()); + + position.set(Position.KEY_SATELLITES, parser.nextInt()); + position.set(Position.KEY_HDOP, parser.nextDouble()); + position.set(Position.PREFIX_ADC + 1, parser.nextInt()); + position.set(Position.PREFIX_IN + 1, parser.nextInt()); + position.set(Position.KEY_CHARGE, parser.next()); + position.set(Position.PREFIX_IN + 2, parser.nextInt()); + position.set(Position.KEY_IGNITION, parser.nextInt() == 1); + position.set(Position.KEY_POWER, parser.nextInt()); + position.set(Position.KEY_BATTERY, parser.nextInt()); + } return position; |