aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/Gs100ProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-04-22 22:33:46 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2021-04-22 22:33:46 -0700
commit149c71740105130d19aa55738042bc5be0280429 (patch)
treef5ff12f92f4ad9eb6e2c43f1c1394f6795bc8ef1 /src/main/java/org/traccar/protocol/Gs100ProtocolDecoder.java
parentbda405e1aa178b33a46edb2c3e2594d74be3bc5c (diff)
downloadtrackermap-server-149c71740105130d19aa55738042bc5be0280429.tar.gz
trackermap-server-149c71740105130d19aa55738042bc5be0280429.tar.bz2
trackermap-server-149c71740105130d19aa55738042bc5be0280429.zip
Fix GPS decoding
Diffstat (limited to 'src/main/java/org/traccar/protocol/Gs100ProtocolDecoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/Gs100ProtocolDecoder.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/protocol/Gs100ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gs100ProtocolDecoder.java
index 28a42476c..69232dd55 100644
--- a/src/main/java/org/traccar/protocol/Gs100ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Gs100ProtocolDecoder.java
@@ -99,15 +99,15 @@ public class Gs100ProtocolDecoder extends BaseProtocolDecoder {
position.setLatitude(Integer.parseInt(coordinates.substring(10, 12))
+ Integer.parseInt(coordinates.substring(12, 18)) * 0.0001 / 60);
int flags = Integer.parseInt(coordinates.substring(9, 10), 16);
- if (!BitUtil.check(flags, 4)) {
+ if (!BitUtil.check(flags, 3)) {
position.setLongitude(-position.getLongitude());
}
- if (!BitUtil.check(flags, 3)) {
+ if (!BitUtil.check(flags, 2)) {
position.setLatitude(-position.getLatitude());
}
String other = ByteBufUtil.hexDump(buf.readSlice(4));
- position.setSpeed(Integer.parseInt(other.substring(0, 5)));
+ position.setSpeed(Integer.parseInt(other.substring(0, 5)) * 0.01);
position.setCourse(Integer.parseInt(other.substring(5, 8)));
} else {