aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r--src/org/traccar/protocol/TelicProtocolDecoder.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/org/traccar/protocol/TelicProtocolDecoder.java b/src/org/traccar/protocol/TelicProtocolDecoder.java
index f6be15cce..bbd4b0574 100644
--- a/src/org/traccar/protocol/TelicProtocolDecoder.java
+++ b/src/org/traccar/protocol/TelicProtocolDecoder.java
@@ -50,11 +50,11 @@ public class TelicProtocolDecoder extends BaseProtocolDecoder {
.number("(d),") // validity
.number("(d+),") // speed
.number("(d+),") // course
- .number("(d+),") // satellites
+ .number("(d+)?,") // satellites
.expression("(?:[^,]*,){7}")
.number("(d+),") // battery
.expression("[^,]*,")
- .number("(d+),") // external
+ .number("(d+)") // external
.any()
.compile();
@@ -125,9 +125,12 @@ public class TelicProtocolDecoder extends BaseProtocolDecoder {
position.setSpeed(UnitsConverter.knotsFromKph(parser.nextDouble()));
position.setCourse(parser.nextDouble());
- position.set(Position.KEY_SATELLITES, parser.next());
- position.set(Position.KEY_BATTERY, 3.4 + parser.nextInt() * 0.00345);
- position.set(Position.KEY_POWER, 6.0 + parser.nextInt() * 0.125);
+ if (parser.hasNext()) {
+ position.set(Position.KEY_SATELLITES, parser.nextInt());
+ }
+
+ position.set(Position.KEY_BATTERY, parser.nextInt());
+ position.set(Position.KEY_POWER, parser.nextInt());
return position;
}