diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-07-14 15:15:31 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-07-14 15:15:31 +1200 |
commit | 7310ee5f15729ea8517bfb6b0890a46da1217610 (patch) | |
tree | 44504738f127708420179a7dbbe2942cb67d0849 /src/org/traccar/protocol/Gt06ProtocolDecoder.java | |
parent | 8e8da7019aab023ae255d0ed6d16b94d303fd468 (diff) | |
parent | 0a6faa86c4b634fa3a94633506c4422623e36f1e (diff) | |
download | trackermap-server-7310ee5f15729ea8517bfb6b0890a46da1217610.tar.gz trackermap-server-7310ee5f15729ea8517bfb6b0890a46da1217610.tar.bz2 trackermap-server-7310ee5f15729ea8517bfb6b0890a46da1217610.zip |
Merge Java 7 update (fix #1273)
Diffstat (limited to 'src/org/traccar/protocol/Gt06ProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/Gt06ProtocolDecoder.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java index 06c3985dc..3bbe87e36 100644 --- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java @@ -156,7 +156,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { // GPS length and Satellites count int gpsLength = buf.readUnsignedByte(); - position.set(Event.KEY_SATELLITES, gpsLength & 0xf); + position.set(Event.KEY_SATELLITES, gpsLength & 0b0000_1111); gpsLength >>= 4; // Latitude @@ -170,16 +170,16 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { // Course and flags int union = buf.readUnsignedShort(); - position.setCourse(union & 0x03FF); - position.setValid((union & 0x1000) != 0); - if ((union & 0x0400) == 0) latitude = -latitude; - if ((union & 0x0800) != 0) longitude = -longitude; + position.setCourse(union & 0b0000_0011_1111_1111); + position.setValid((union & 0b0001_0000_0000_0000) != 0); + if ((union & 0b0000_0100_0000_0000) == 0) latitude = -latitude; + if ((union & 0b0000_1000_0000_0000) != 0) longitude = -longitude; position.setLatitude(latitude); position.setLongitude(longitude); - if ((union & 0x4000) != 0) { - position.set("acc", (union & 0x8000) != 0); + if ((union & 0b0100_0000_0000_0000) != 0) { + position.set("acc", (union & 0b1000_0000_0000_0000) != 0); } buf.skipBytes(gpsLength - 12); // skip reserved |