aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-07-04 08:02:33 -0700
committerAnton Tananaev <anton@traccar.org>2023-07-04 08:02:33 -0700
commit52799453e0ee9a9db3cbad58138712c8c40c458f (patch)
tree0730f71a04fbfb9f1eebb6098d9b72393705c25e /src/main/java/org/traccar/protocol
parent8b4d3ee0b96407ad3c889bc3bb0261e5ebe60532 (diff)
downloadtrackermap-server-52799453e0ee9a9db3cbad58138712c8c40c458f.tar.gz
trackermap-server-52799453e0ee9a9db3cbad58138712c8c40c458f.tar.bz2
trackermap-server-52799453e0ee9a9db3cbad58138712c8c40c458f.zip
iStartek VT200 ACC on time
Diffstat (limited to 'src/main/java/org/traccar/protocol')
-rw-r--r--src/main/java/org/traccar/protocol/StartekProtocolDecoder.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/main/java/org/traccar/protocol/StartekProtocolDecoder.java b/src/main/java/org/traccar/protocol/StartekProtocolDecoder.java
index d08bb92a8..9c749c8d9 100644
--- a/src/main/java/org/traccar/protocol/StartekProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/StartekProtocolDecoder.java
@@ -72,12 +72,10 @@ public class StartekProtocolDecoder extends BaseProtocolDecoder {
.number("(x+)") // battery
.expression("([^,]+)?") // adc
.groupBegin()
- .text(",")
- .number("d,") // extended
- .expression("([^,]+)?") // fuel
+ .number(",d+") // extended
+ .expression(",([^,]+)?") // fuel
.groupBegin()
- .text(",")
- .expression("([^,]+)?") // temperature
+ .expression(",([^,]+)?") // temperature
.groupBegin()
.text(",")
.groupBegin()
@@ -91,9 +89,11 @@ public class StartekProtocolDecoder extends BaseProtocolDecoder {
.number("(d+)?|") // instant fuel
.number("(d+)[%L]").optional() // fuel level
.groupEnd("?")
+ .number(",(d+)").optional() // hours
.groupEnd("?")
.groupEnd("?")
.groupEnd("?")
+ .any()
.compile();
private String decodeAlarm(int value) {
@@ -224,7 +224,7 @@ public class StartekProtocolDecoder extends BaseProtocolDecoder {
}
}
- if (parser.hasNextAny(6)) {
+ if (parser.hasNextAny(9)) {
position.set(Position.KEY_RPM, parser.nextInt());
position.set(Position.KEY_ENGINE_LOAD, parser.nextInt());
position.set("airFlow", parser.nextInt());
@@ -242,6 +242,10 @@ public class StartekProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_FUEL_LEVEL, parser.nextInt());
}
+ if (parser.hasNext()) {
+ position.set(Position.KEY_HOURS, parser.nextInt() * 1000L);
+ }
+
return position;
}