aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol
diff options
context:
space:
mode:
authorstefanclark <stefanclark@users.noreply.github.com>2022-07-21 21:21:13 +0100
committerGitHub <noreply@github.com>2022-07-21 21:21:13 +0100
commitbf9b8c9562587476a919e095a4adc6c00bb2cba8 (patch)
treea069dc4ef5264fcbe533dc3a232704e937a567a6 /src/main/java/org/traccar/protocol
parent63dbc22b68d4825dcf36a5c694456c9ea267ebfc (diff)
downloadtrackermap-server-bf9b8c9562587476a919e095a4adc6c00bb2cba8.tar.gz
trackermap-server-bf9b8c9562587476a919e095a4adc6c00bb2cba8.tar.bz2
trackermap-server-bf9b8c9562587476a919e095a4adc6c00bb2cba8.zip
Update Xexun2ProtocolDecoder.java
Diffstat (limited to 'src/main/java/org/traccar/protocol')
-rw-r--r--src/main/java/org/traccar/protocol/Xexun2ProtocolDecoder.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/Xexun2ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Xexun2ProtocolDecoder.java
index a572f8622..42fa7d8f2 100644
--- a/src/main/java/org/traccar/protocol/Xexun2ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Xexun2ProtocolDecoder.java
@@ -176,7 +176,19 @@ public class Xexun2ProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_SATELLITES, buf.readUnsignedByte());
position.setLongitude(convertCoordinate(buf.readDouble()));
position.setLatitude(convertCoordinate(buf.readDouble()));
-
+ }
+ if (BitUtil.check(positionMask, 7)) {
+ buf.skipBytes(2); // length = 30
+ buf.skipBytes(1); // marker = 'G'
+ buf.skipBytes(2); // length = 27
+ position.setLongitude(convertCoordinate(buf.readDouble()));
+ position.setLatitude(convertCoordinate(buf.readDouble()));
+ position.setValid(buf.readUnsignedByte()>0); // 0=invalid,1=normal,2=sub-meter,3=differential
+ position.set(Position.KEY_SATELLITES, buf.readUnsignedByte());
+ buf.skipBytes(1); // SNR
+ position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedShort() * 0.1));
+ position.setCourse(buf.readUnsignedShort() * 0.1);
+ position.setAltitude(buf.readFloat());
}
}
if (BitUtil.check(mask, 3)) {