diff options
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/traccar/protocol/Tk103ProtocolDecoder.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/Tk103ProtocolDecoder.java b/src/org/traccar/protocol/Tk103ProtocolDecoder.java index be3def453..1a5ada81b 100644 --- a/src/org/traccar/protocol/Tk103ProtocolDecoder.java +++ b/src/org/traccar/protocol/Tk103ProtocolDecoder.java @@ -63,6 +63,10 @@ public class Tk103ProtocolDecoder extends BaseProtocolDecoder { .number("(?:L(x+))?") // odometer .any() .number("([+-]ddd.d)?") // temperature + .groupBegin() + .number("([+-]?d+.d{1,2}),").optional() // altitude + .number("(d+)$").optional() // number of visible satellites + .groupEnd("?") .text(")").optional() .compile(); @@ -299,6 +303,15 @@ public class Tk103ProtocolDecoder extends BaseProtocolDecoder { position.set(Position.PREFIX_TEMP + 1, parser.nextDouble(0)); } + if (parser.hasNext()) { + position.setAltitude(parser.nextDouble(0)); + } + + if (parser.hasNext()) { + // Store amount of visible satellites as RSSI + position.set(Position.KEY_RSSI, parser.nextInt(0)); + } + return position; } |