aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-05-27 21:27:50 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2021-05-27 21:27:57 -0700
commitabf3fc0e3b440a15ad1cade05324fc6e13bfb25d (patch)
tree813d5c56114ac06c24294ee0b9534683ae6256e3 /src/main/java/org/traccar/protocol
parent3ebd7383a9fdf797ac06fbe8988c2cba0430410d (diff)
downloadtrackermap-server-abf3fc0e3b440a15ad1cade05324fc6e13bfb25d.tar.gz
trackermap-server-abf3fc0e3b440a15ad1cade05324fc6e13bfb25d.tar.bz2
trackermap-server-abf3fc0e3b440a15ad1cade05324fc6e13bfb25d.zip
Decode driver id
Diffstat (limited to 'src/main/java/org/traccar/protocol')
-rw-r--r--src/main/java/org/traccar/protocol/StartekProtocolDecoder.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/StartekProtocolDecoder.java b/src/main/java/org/traccar/protocol/StartekProtocolDecoder.java
index d7a1c932f..1cc69c6e6 100644
--- a/src/main/java/org/traccar/protocol/StartekProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/StartekProtocolDecoder.java
@@ -43,7 +43,7 @@ public class StartekProtocolDecoder extends BaseProtocolDecoder {
.number("(d+),") // imei
.number("xxx,") // command
.number("(d+),") // event
- .expression("[^,]*,") // event data
+ .expression("([^,]+)?,") // event data
.number("(dd)(dd)(dd)") // date (yyymmdd)
.number("(dd)(dd)(dd),") // time (hhmmss)
.expression("([AV]),") // valid
@@ -106,8 +106,13 @@ public class StartekProtocolDecoder extends BaseProtocolDecoder {
position.setDeviceId(deviceSession.getDeviceId());
int event = parser.nextInt();
- position.set(Position.KEY_ALARM, decodeAlarm(event));
+ String eventData = parser.next();
position.set(Position.KEY_EVENT, event);
+ if (event == 53) {
+ position.set(Position.KEY_DRIVER_UNIQUE_ID, eventData);
+ } else {
+ position.set(Position.KEY_ALARM, decodeAlarm(event));
+ }
position.setTime(parser.nextDateTime());
position.setValid(parser.next().equals("A"));