aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-03-29 19:23:32 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2019-03-29 19:23:32 -0700
commit12ac2cf773b6fa621b48dc6177d8245e038a8918 (patch)
treebec56b16ac256537ae84b8bdc770ca4e99588755 /src/org/traccar
parent1f710ea91b25aec02d04b69e5b9f6dbd96230a82 (diff)
downloadtrackermap-server-12ac2cf773b6fa621b48dc6177d8245e038a8918.tar.gz
trackermap-server-12ac2cf773b6fa621b48dc6177d8245e038a8918.tar.bz2
trackermap-server-12ac2cf773b6fa621b48dc6177d8245e038a8918.zip
Support decimal heading values
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/protocol/XirgoProtocolDecoder.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/XirgoProtocolDecoder.java b/src/org/traccar/protocol/XirgoProtocolDecoder.java
index 38c21f387..6d215e672 100644
--- a/src/org/traccar/protocol/XirgoProtocolDecoder.java
+++ b/src/org/traccar/protocol/XirgoProtocolDecoder.java
@@ -228,7 +228,11 @@ public class XirgoProtocolDecoder extends BaseProtocolDecoder {
position.setSpeed(UnitsConverter.knotsFromKph(Double.parseDouble(values[i])));
break;
case "HD":
- position.setCourse(Integer.parseInt(values[i]) * 0.1);
+ if (values[i].contains(".")) {
+ position.setCourse(Double.parseDouble(values[i]));
+ } else {
+ position.setCourse(Integer.parseInt(values[i]) * 0.1);
+ }
break;
case "SV":
position.set(Position.KEY_SATELLITES, Integer.parseInt(values[i]));