aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/Gps103ProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-12-11 23:03:31 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2018-12-11 23:03:38 -0800
commit757d5c176f84834de6b20000692e8f6bd7d57edc (patch)
treec124a181e5a09bb5c509d3052c47cba686de64ee /src/org/traccar/protocol/Gps103ProtocolDecoder.java
parenta642b73c6cc727f4baa3c5ca7a5cc9b0679fead2 (diff)
downloadtrackermap-server-757d5c176f84834de6b20000692e8f6bd7d57edc.tar.gz
trackermap-server-757d5c176f84834de6b20000692e8f6bd7d57edc.tar.bz2
trackermap-server-757d5c176f84834de6b20000692e8f6bd7d57edc.zip
Decode additional Ericar attributes
Diffstat (limited to 'src/org/traccar/protocol/Gps103ProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/Gps103ProtocolDecoder.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/Gps103ProtocolDecoder.java b/src/org/traccar/protocol/Gps103ProtocolDecoder.java
index 72e8430ba..c0f485349 100644
--- a/src/org/traccar/protocol/Gps103ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gps103ProtocolDecoder.java
@@ -104,9 +104,9 @@ public class Gps103ProtocolDecoder extends BaseProtocolDecoder {
.text("imei:")
.number("(d+),") // imei
.expression("[^,]+,")
- .expression("...,") // event
- .expression(".{6},") // sensor id
- .expression(".{4},") // sensor voltage
+ .expression("(?:-+|(.+)),") // event
+ .expression("(?:-+|(.+)),") // sensor id
+ .expression("(?:-+|(.+)),") // sensor voltage
.number("(dd)(dd)(dd),") // time (hhmmss)
.number("(dd)(dd)(dd),") // date (ddmmyy)
.number("(d+),") // rssi
@@ -118,6 +118,9 @@ public class Gps103ProtocolDecoder extends BaseProtocolDecoder {
.number("(-?d+),") // altitude
.number("(d+.d+),") // hdop
.number("(d+),") // satellites
+ .number("([01]),") // ignition
+ .number("([01]),") // charge
+ .expression("(?:-+|(.+))") // error
.any()
.compile();
@@ -307,6 +310,10 @@ public class Gps103ProtocolDecoder extends BaseProtocolDecoder {
Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
+ position.set(Position.KEY_EVENT, parser.next());
+ position.set("sensorId", parser.next());
+ position.set("sensorVoltage", parser.nextDouble());
+
position.setTime(parser.nextDateTime(Parser.DateTimeFormat.HMS_DMY));
position.set(Position.KEY_RSSI, parser.nextInt());
@@ -320,6 +327,9 @@ public class Gps103ProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_HDOP, parser.nextDouble());
position.set(Position.KEY_SATELLITES, parser.nextInt());
+ position.set(Position.KEY_IGNITION, parser.nextInt() > 0);
+ position.set(Position.KEY_CHARGE, parser.nextInt() > 0);
+ position.set("error", parser.next());
return position;
}