aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-29 17:04:30 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-29 17:04:30 -0700
commitef523bb4db2c48d7d07a326157d5758199ed293f (patch)
tree520f6104ba5da5a06ee2156064770b90da43ac64
parentaed0411f4ae5cfc007d27e0521a39a242fab7840 (diff)
downloadtrackermap-server-ef523bb4db2c48d7d07a326157d5758199ed293f.tar.gz
trackermap-server-ef523bb4db2c48d7d07a326157d5758199ed293f.tar.bz2
trackermap-server-ef523bb4db2c48d7d07a326157d5758199ed293f.zip
Fix ThinkPower negative coords
-rw-r--r--src/main/java/org/traccar/protocol/ThinkPowerProtocolDecoder.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/protocol/ThinkPowerProtocolDecoder.java b/src/main/java/org/traccar/protocol/ThinkPowerProtocolDecoder.java
index 26d60daba..e7ab23e5b 100644
--- a/src/main/java/org/traccar/protocol/ThinkPowerProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/ThinkPowerProtocolDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021 Anton Tananaev (anton@traccar.org)
+ * Copyright 2021 - 2022 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@ import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.Channel;
import org.traccar.BaseProtocolDecoder;
-import org.traccar.helper.BitUtil;
+import org.traccar.helper.BufferUtil;
import org.traccar.session.DeviceSession;
import org.traccar.NetworkMessage;
import org.traccar.Protocol;
@@ -65,8 +65,8 @@ public class ThinkPowerProtocolDecoder extends BaseProtocolDecoder {
switch (type) {
case 0x01:
position.setValid(true);
- position.setLatitude(buf.readInt() * 0.0000001);
- position.setLongitude(buf.readInt() * 0.0000001);
+ position.setLatitude(BufferUtil.readSignedMagnitudeInt(buf) * 0.0000001);
+ position.setLongitude(BufferUtil.readSignedMagnitudeInt(buf) * 0.0000001);
position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedShort() * 0.1));
position.setCourse(buf.readUnsignedShort() * 0.01);
break;