aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/Jt600ProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-11-25 08:06:25 -0800
committerAnton Tananaev <anton@traccar.org>2023-11-25 08:06:25 -0800
commit25c5e09b02ae9e498562f3fe9a80bd6d7463a11b (patch)
treee71c75d83695b6837c4d8afb2a2814ee38cc17ca /src/main/java/org/traccar/protocol/Jt600ProtocolDecoder.java
parent41b5577dd8574309104c880191a35ba3bca600d4 (diff)
downloadtrackermap-server-25c5e09b02ae9e498562f3fe9a80bd6d7463a11b.tar.gz
trackermap-server-25c5e09b02ae9e498562f3fe9a80bd6d7463a11b.tar.bz2
trackermap-server-25c5e09b02ae9e498562f3fe9a80bd6d7463a11b.zip
Support JT705A additional data
Diffstat (limited to 'src/main/java/org/traccar/protocol/Jt600ProtocolDecoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/Jt600ProtocolDecoder.java12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/main/java/org/traccar/protocol/Jt600ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Jt600ProtocolDecoder.java
index 1b6d471b4..eca7e2d11 100644
--- a/src/main/java/org/traccar/protocol/Jt600ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Jt600ProtocolDecoder.java
@@ -105,15 +105,9 @@ public class Jt600ProtocolDecoder extends BaseProtocolDecoder {
double longitude = convertCoordinate(BcdUtil.readInteger(buf, 9));
byte flags = buf.readByte();
- position.setValid((flags & 0x1) == 0x1);
- if ((flags & 0x2) == 0) {
- latitude = -latitude;
- }
- position.setLatitude(latitude);
- if ((flags & 0x4) == 0) {
- longitude = -longitude;
- }
- position.setLongitude(longitude);
+ position.setValid(BitUtil.check(flags, 0));
+ position.setLatitude(BitUtil.check(flags, 1) ? latitude : -latitude);
+ position.setLongitude(BitUtil.check(flags, 2) ? longitude : -longitude);
position.setSpeed(BcdUtil.readInteger(buf, 2));
position.setCourse(buf.readUnsignedByte() * 2.0);