aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/protocol/Gps103ProtocolDecoder.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/org/traccar/protocol/Gps103ProtocolDecoder.java b/src/org/traccar/protocol/Gps103ProtocolDecoder.java
index c0f485349..1fbae15ce 100644
--- a/src/org/traccar/protocol/Gps103ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gps103ProtocolDecoder.java
@@ -73,9 +73,11 @@ public class Gps103ProtocolDecoder extends BaseProtocolDecoder {
.number(",(d+.?d*)?").optional() // altitude
.number(",([01])?").optional() // ignition
.number(",([01])?").optional() // door
- .number(",(?:(d+.d+)%)?").optional() // fuel 1
- .number(",(?:(d+.d+)%)?").optional() // fuel 2
- .number("(-?d+)?") // temperature
+ .groupBegin()
+ .number(",(?:(d+.d+)%)?") // fuel 1
+ .number(",(?:(d+.d+)%|d+)?") // fuel 2
+ .groupEnd("?")
+ .number(",([-+]?d+)?") // temperature
.groupEnd()
.any()
.compile();
@@ -193,7 +195,7 @@ public class Gps103ProtocolDecoder extends BaseProtocolDecoder {
} else if (alarm.equals("acc off")) {
position.set(Position.KEY_IGNITION, false);
} else if (alarm.startsWith("T:")) {
- position.set(Position.PREFIX_TEMP + 1, alarm.substring(2));
+ position.set(Position.PREFIX_TEMP + 1, Double.parseDouble(alarm.substring(2)));
} else if (alarm.startsWith("oil ")) {
position.set(Position.KEY_FUEL_LEVEL, Double.parseDouble(alarm.substring(4)));
} else if (!position.getAttributes().containsKey(Position.KEY_ALARM) && !alarm.equals("tracker")) {