aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar
diff options
context:
space:
mode:
authorSanjeewa Vithanage <vithanagevms@gmail.com>2024-01-28 09:28:34 +0200
committerSanjeewa Vithanage <vithanagevms@gmail.com>2024-01-28 09:28:34 +0200
commit2f49889aa496524b298f764e18f8016e74efab87 (patch)
treede9ea5931d0a369e052d46a10d681c921911cd25 /src/main/java/org/traccar
parent7577626863a370056169386860a3e8805f45663b (diff)
downloadtrackermap-server-2f49889aa496524b298f764e18f8016e74efab87.tar.gz
trackermap-server-2f49889aa496524b298f764e18f8016e74efab87.tar.bz2
trackermap-server-2f49889aa496524b298f764e18f8016e74efab87.zip
fixed with unwanted decimal points ("adc1":12.870000000000001)
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r--src/main/java/org/traccar/protocol/UproProtocolDecoder.java6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/protocol/UproProtocolDecoder.java b/src/main/java/org/traccar/protocol/UproProtocolDecoder.java
index 2f88d803c..1167f568c 100644
--- a/src/main/java/org/traccar/protocol/UproProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/UproProtocolDecoder.java
@@ -311,10 +311,8 @@ public class UproProtocolDecoder extends BaseProtocolDecoder {
}
break;
case 'd':
- if (data.readableBytes() > 3) {
- position.set(Position.PREFIX_ADC + 1, Integer.parseInt(data.readSlice(5).
- toString(StandardCharsets.US_ASCII)) * 0.01);
- }
+ position.set(Position.PREFIX_ADC + 1, Integer.parseInt(data.
+ toString(StandardCharsets.US_ASCII))/100.0);
break;
default:
break;