aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/Ivt401ProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-03-08 05:30:22 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2018-03-08 05:30:22 +1300
commit34499f29f0f20c4acecc455fde67c5332790e926 (patch)
treeca7d5991fd1f0cc55c33d6a1b0210aadcc660f22 /src/org/traccar/protocol/Ivt401ProtocolDecoder.java
parent9145f9f823602c7da7a93a119b608c7a35d4ef60 (diff)
downloadtrackermap-server-34499f29f0f20c4acecc455fde67c5332790e926.tar.gz
trackermap-server-34499f29f0f20c4acecc455fde67c5332790e926.tar.bz2
trackermap-server-34499f29f0f20c4acecc455fde67c5332790e926.zip
Decode additional TL3000 data
Diffstat (limited to 'src/org/traccar/protocol/Ivt401ProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/Ivt401ProtocolDecoder.java38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/Ivt401ProtocolDecoder.java b/src/org/traccar/protocol/Ivt401ProtocolDecoder.java
index 6e11a763c..d2f1d3d69 100644
--- a/src/org/traccar/protocol/Ivt401ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Ivt401ProtocolDecoder.java
@@ -58,6 +58,23 @@ public class Ivt401ProtocolDecoder extends BaseProtocolDecoder {
.number("(-?d+),") // tilt
.number("(d+),") // trip
.number("(d+),") // odometer
+ .groupBegin()
+ .number("([01]),") // overspeed
+ .number("[01],") // input 2 misuse
+ .number("[01],") // immobilizer
+ .number("[01],") // temperature alert
+ .number("[0-2]+,") // geofence
+ .number("([0-3]),") // harsh driving
+ .number("[01],") // reconnect
+ .number("([01]),") // low battery
+ .number("([01]),") // power disconnected
+ .number("[01],") // gps failure
+ .number("([01]),") // towing
+ .number("[01],") // server unreachable
+ .number("[128],") // sleep mode
+ .expression("([^,]+)?,") // driver id
+ .number("d+,") // sms count
+ .groupEnd("?")
.any()
.compile();
@@ -138,6 +155,27 @@ public class Ivt401ProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_ODOMETER, parser.nextLong());
+ if (parser.hasNext(6)) {
+ position.set(Position.KEY_ALARM, parser.nextInt() == 1 ? Position.ALARM_OVERSPEED : null);
+ switch (parser.nextInt()) {
+ case 1:
+ position.set(Position.KEY_ALARM, Position.ALARM_ACCELERATION);
+ break;
+ case 2:
+ position.set(Position.KEY_ALARM, Position.ALARM_BRAKING);
+ break;
+ case 3:
+ position.set(Position.KEY_ALARM, Position.ALARM_CORNERING);
+ break;
+ default:
+ break;
+ }
+ position.set(Position.KEY_ALARM, parser.nextInt() == 1 ? Position.ALARM_LOW_BATTERY : null);
+ position.set(Position.KEY_ALARM, parser.nextInt() == 1 ? Position.ALARM_POWER_CUT : null);
+ position.set(Position.KEY_ALARM, parser.nextInt() == 1 ? Position.ALARM_TOW : null);
+ position.set(Position.KEY_DRIVER_UNIQUE_ID, parser.next());
+ }
+
return position;
}