aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol
diff options
context:
space:
mode:
authorAlexandre Truppel <alex.truppel@gmail.com>2023-02-22 15:50:19 +0100
committerAlexandre Truppel <alex.truppel@gmail.com>2023-02-22 15:50:19 +0100
commitba6a9d72e62282d64781b856b8e094e1fb612f9e (patch)
tree71189c5a3450d22551ad46bbb519da5fafadd1fa /src/main/java/org/traccar/protocol
parent345262a970292541c07aee9982c6a26a29c11f9c (diff)
downloadtrackermap-server-ba6a9d72e62282d64781b856b8e094e1fb612f9e.tar.gz
trackermap-server-ba6a9d72e62282d64781b856b8e094e1fb612f9e.tar.bz2
trackermap-server-ba6a9d72e62282d64781b856b8e094e1fb612f9e.zip
Added "setAccuracy" special case, with tests
Diffstat (limited to 'src/main/java/org/traccar/protocol')
-rw-r--r--src/main/java/org/traccar/protocol/WialonProtocolDecoder.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/WialonProtocolDecoder.java b/src/main/java/org/traccar/protocol/WialonProtocolDecoder.java
index 4c4ff7a63..e2ccfe9d8 100644
--- a/src/main/java/org/traccar/protocol/WialonProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/WialonProtocolDecoder.java
@@ -148,7 +148,16 @@ public class WialonProtocolDecoder extends BaseProtocolDecoder {
// (true, yes, etc), in which case we convert into a boolean
try {
- position.set(key, Double.parseDouble(value));
+ double double_value = Double.parseDouble(value);
+
+ // Since accuracy is not part of the general parameter list,
+ // we need to handle it separately by calling setAccuracy directly
+ if (key.equals("accuracy")) {
+ position.setAccuracy(double_value);
+ }
+ else {
+ position.set(key, double_value);
+ }
} catch (NumberFormatException e) {
if (value.equalsIgnoreCase("true") || value.equalsIgnoreCase("t")
|| value.equalsIgnoreCase("yes") || value.equalsIgnoreCase("y")