diff options
author | Valerii Vyshniak <valeravi@vi-soft.com.ua> | 2017-11-16 00:07:04 +0100 |
---|---|---|
committer | Valerii Vyshniak <valeravi@vi-soft.com.ua> | 2017-11-18 18:51:50 +0100 |
commit | 2f98dd6c9f151f48d31ecd09ee06ccbcd4430b97 (patch) | |
tree | e90e27da953e8f347264bbe295471eed468a519a /src/org/traccar/protocol/Tk103ProtocolDecoder.java | |
parent | fb9cbb2b74dc0060bd0dc5d0b3bfeb958ed6f3b5 (diff) | |
download | trackermap-server-2f98dd6c9f151f48d31ecd09ee06ccbcd4430b97.tar.gz trackermap-server-2f98dd6c9f151f48d31ecd09ee06ccbcd4430b97.tar.bz2 trackermap-server-2f98dd6c9f151f48d31ecd09ee06ccbcd4430b97.zip |
T580W: parse altitude and satellites num in GPS data packet
Diffstat (limited to 'src/org/traccar/protocol/Tk103ProtocolDecoder.java')
-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; } |