aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorOliver Schramm <oliver.schramm97@gmail.com>2021-05-26 02:19:11 +0200
committerOliver Schramm <oliver.schramm97@gmail.com>2021-05-26 02:20:29 +0200
commit4581380113a7edf67936a0d567fc469de709e508 (patch)
tree42fe02daa42b110967ea5c33906f4f94adc9ddf4 /src/main/java
parent8d1e86a7a06f1525a64c44b262758a216b084159 (diff)
downloadtrackermap-server-4581380113a7edf67936a0d567fc469de709e508.tar.gz
trackermap-server-4581380113a7edf67936a0d567fc469de709e508.tar.bz2
trackermap-server-4581380113a7edf67936a0d567fc469de709e508.zip
Adjust code style
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/traccar/protocol/MegastekProtocolDecoder.java7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/main/java/org/traccar/protocol/MegastekProtocolDecoder.java b/src/main/java/org/traccar/protocol/MegastekProtocolDecoder.java
index 074523a76..82c616245 100644
--- a/src/main/java/org/traccar/protocol/MegastekProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/MegastekProtocolDecoder.java
@@ -275,10 +275,7 @@ public class MegastekProtocolDecoder extends BaseProtocolDecoder {
.or().text(" ")
.groupEnd("?").text(",")
.number("(d+)?,") // rfid
- .groupBegin() // ext accessories
- .number("([01])") // charging
- .number("(d)?") // belt status
- .groupEnd("?")
+ .number("([01])(d)?").optional() // charge and belt status
.expression("[^,]*,")
.number("(d+)?,") // battery
.expression("([^,]*)[,;]") // alert
@@ -360,7 +357,7 @@ public class MegastekProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_DRIVER_UNIQUE_ID, parser.next());
if (parser.hasNext()) {
- position.set(Position.KEY_CHARGE, parser.nextInt() == 1);
+ position.set(Position.KEY_CHARGE, parser.nextInt() > 0);
}
if (parser.hasNext()) {
position.set("belt", parser.nextInt());