aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-06-02 13:47:51 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2016-06-02 13:49:02 +1200
commit06a746b44dae69b0c84a5302f92a1bcbe2dc827f (patch)
treedcefdd99ffc2106e96e3445f81ee5800aead2222 /src
parentf0750a4b89088f05af6f561201b43ceeb407bd35 (diff)
downloadtrackermap-server-06a746b44dae69b0c84a5302f92a1bcbe2dc827f.tar.gz
trackermap-server-06a746b44dae69b0c84a5302f92a1bcbe2dc827f.tar.bz2
trackermap-server-06a746b44dae69b0c84a5302f92a1bcbe2dc827f.zip
Properly decode Telic info (fix #1735)
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/protocol/TelicProtocolDecoder.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/TelicProtocolDecoder.java b/src/org/traccar/protocol/TelicProtocolDecoder.java
index 812aeec0a..b8929fae5 100644
--- a/src/org/traccar/protocol/TelicProtocolDecoder.java
+++ b/src/org/traccar/protocol/TelicProtocolDecoder.java
@@ -51,7 +51,8 @@ public class TelicProtocolDecoder extends BaseProtocolDecoder {
.number("(d+),") // course
.number("(d+),") // satellites
.expression("(?:[^,]*,){7}")
- .number("(d+),")
+ .number("(d+),") // battery
+ .number("(d+),") // external
.any()
.compile();
@@ -94,7 +95,8 @@ public class TelicProtocolDecoder extends BaseProtocolDecoder {
position.setCourse(parser.nextDouble());
position.set(Position.KEY_SATELLITES, parser.next());
- position.set(Position.KEY_BATTERY, parser.nextInt());
+ position.set(Position.KEY_BATTERY, 3.4 + parser.nextInt() * 0.00345);
+ position.set(Position.KEY_POWER, 6.0 + parser.nextInt() * 0.125);
return position;
}