diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-04-17 16:59:36 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-04-17 16:59:36 +1200 |
commit | 57941c8095839951caf868368963ba13e8fc3da3 (patch) | |
tree | 8e3e4290a47d0ad61c2cab291a74bba7e0e00057 /src/org | |
parent | d643e9a75f1c6580d098b68cffc2c709db611d8e (diff) | |
download | traccar-server-57941c8095839951caf868368963ba13e8fc3da3.tar.gz traccar-server-57941c8095839951caf868368963ba13e8fc3da3.tar.bz2 traccar-server-57941c8095839951caf868368963ba13e8fc3da3.zip |
Decode numeric OsmAnd parameters
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/traccar/protocol/OsmAndProtocolDecoder.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/OsmAndProtocolDecoder.java b/src/org/traccar/protocol/OsmAndProtocolDecoder.java index 382865e8f..579dbe3e6 100644 --- a/src/org/traccar/protocol/OsmAndProtocolDecoder.java +++ b/src/org/traccar/protocol/OsmAndProtocolDecoder.java @@ -129,7 +129,11 @@ public class OsmAndProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_BATTERY, value); break; default: - position.set(entry.getKey(), value); + try { + position.set(entry.getKey(), Double.parseDouble(value)); + } catch (NumberFormatException e) { + position.set(entry.getKey(), value); + } break; } } |