diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-04-27 12:12:41 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-04-27 12:12:41 +1200 |
commit | 42406b4d6a32db0d438447a5fce114669810d746 (patch) | |
tree | b9a95ec3ce512ea195318c472f1f2320c73275e8 /src/org/traccar/protocol/OsmAndProtocolDecoder.java | |
parent | c727f09de176f569e67550964c65a63d4dcdea6b (diff) | |
download | trackermap-server-42406b4d6a32db0d438447a5fce114669810d746.tar.gz trackermap-server-42406b4d6a32db0d438447a5fce114669810d746.tar.bz2 trackermap-server-42406b4d6a32db0d438447a5fce114669810d746.zip |
Remove unnecessary default values
Diffstat (limited to 'src/org/traccar/protocol/OsmAndProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/OsmAndProtocolDecoder.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/org/traccar/protocol/OsmAndProtocolDecoder.java b/src/org/traccar/protocol/OsmAndProtocolDecoder.java index 85cf1219c..11966e0bd 100644 --- a/src/org/traccar/protocol/OsmAndProtocolDecoder.java +++ b/src/org/traccar/protocol/OsmAndProtocolDecoder.java @@ -88,33 +88,34 @@ public class OsmAndProtocolDecoder extends BaseProtocolDecoder { // Optional parameters if (params.containsKey("speed")) { position.setSpeed(Double.valueOf(params.get("speed").get(0))); - } else { - position.setSpeed(0.0); } + if (params.containsKey("bearing")) { position.setCourse(Double.valueOf(params.get("bearing").get(0))); } else if (params.containsKey("heading")) { position.setCourse(Double.valueOf(params.get("heading").get(0))); - } else { - position.setCourse(0.0); } + if (params.containsKey("altitude")) { position.setAltitude(Double.valueOf(params.get("altitude").get(0))); - } else { - position.setAltitude(0.0); } + if (params.containsKey("hdop")) { extendedInfo.set("hdop", params.get("hdop").get(0)); } + if (params.containsKey("vacc")) { extendedInfo.set("vacc", params.get("vacc").get(0)); } + if (params.containsKey("hacc")) { extendedInfo.set("hacc", params.get("hacc").get(0)); } + if (params.containsKey("batt")) { extendedInfo.set("battery", params.get("batt").get(0)); } + if (params.containsKey("desc")) { extendedInfo.set("description", params.get("desc").get(0)); } |