aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/Gt06ProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-20 13:59:44 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-20 13:59:44 +1300
commit06b5113f3d98a44530c2ade6810bc75092fccc31 (patch)
treecb8c03c8f3394db0691b73547e86d2a181462607 /src/org/traccar/protocol/Gt06ProtocolDecoder.java
parent7b103b43754de283e423df03042c6f75307c8466 (diff)
downloadtraccar-server-06b5113f3d98a44530c2ade6810bc75092fccc31.tar.gz
traccar-server-06b5113f3d98a44530c2ade6810bc75092fccc31.tar.bz2
traccar-server-06b5113f3d98a44530c2ade6810bc75092fccc31.zip
Refactor bit utililies class
Diffstat (limited to 'src/org/traccar/protocol/Gt06ProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/Gt06ProtocolDecoder.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
index e319d9e81..396fe686a 100644
--- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -26,6 +26,7 @@ import org.jboss.netty.buffer.ChannelBuffers;
import org.jboss.netty.channel.Channel;
import org.traccar.BaseProtocolDecoder;
import org.traccar.Context;
+import org.traccar.helper.BitUtil;
import org.traccar.helper.Checksum;
import org.traccar.helper.DateBuilder;
import org.traccar.helper.UnitsConverter;
@@ -155,7 +156,9 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
} else if (hasDeviceId()) {
- if (MESSAGES_SUPPORTED.contains(type)) {
+ if (type == MSG_GPS || type == MSG_GPS_LBS_1 || type == MSG_GPS_LBS_2
+ || type == MSG_GPS_LBS_STATUS_1 || type == MSG_GPS_LBS_STATUS_2 || type == MSG_GPS_LBS_STATUS_3
+ || type == MSG_GPS_PHONE || type == MSG_GPS_LBS_EXTEND) {
Position position = new Position();
position.setDeviceId(getDeviceId());
@@ -168,7 +171,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
// GPS length and Satellites count
int gpsLength = buf.readUnsignedByte();
- position.set(Event.KEY_SATELLITES, gpsLength & 0b0000_1111);
+ position.set(Event.KEY_SATELLITES, BitUtil.to(gpsLength, 4));
gpsLength >>= 4;
// Latitude