aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/protocol/TotemProtocolDecoder.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/org/traccar/protocol/TotemProtocolDecoder.java b/src/org/traccar/protocol/TotemProtocolDecoder.java
index db25a3f17..3f8d66a2b 100644
--- a/src/org/traccar/protocol/TotemProtocolDecoder.java
+++ b/src/org/traccar/protocol/TotemProtocolDecoder.java
@@ -50,9 +50,9 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder {
.number("(dd)(dd)(dd)") // date
.expression("[^*]*").text("*")
.number("xx|") // checksum
- .number("(d+.d+)|") // pdop
+ .number("(d+.d+)|") // pdop
.number("(d+.d+)|") // hdop
- .number("(d+.d+)|") // vdop
+ .number("(d+.d+)|") // vdop
.number("(d+)|") // io status
.number("d+|") // time
.number("d") // charged
@@ -242,9 +242,14 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder {
}
position.setTime(dateBuilder.getDate());
- position.set("pdop", parser.next());
- position.set(Position.KEY_HDOP, parser.next());
- position.set("vdop", parser.next());
+ if (pattern == PATTERN1) {
+ position.set("pdop", parser.next());
+ position.set(Position.KEY_HDOP, parser.next());
+ position.set("vdop", parser.next());
+ } else if (pattern == PATTERN2) {
+ position.set(Position.KEY_HDOP, parser.next());
+ }
+
position.set(Position.PREFIX_IO + 1, parser.next());
position.set(Position.KEY_BATTERY, parser.next());
position.set(Position.KEY_POWER, parser.nextDouble());