aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2013-12-03 19:29:34 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2013-12-03 19:29:34 +1300
commit1208b77474498432364e03550a953962d2eac015 (patch)
tree96a0b7e32aaa6f4baeced6460b728d9747c84542 /src
parent1c70f6cad768f47ec8c49444e03691727699322b (diff)
downloadtrackermap-server-1208b77474498432364e03550a953962d2eac015.tar.gz
trackermap-server-1208b77474498432364e03550a953962d2eac015.tar.bz2
trackermap-server-1208b77474498432364e03550a953962d2eac015.zip
Parse acc status (fix #470)
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/protocol/Gt06ProtocolDecoder.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
index d67e6843e..351098626 100644
--- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -74,9 +74,6 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
}
}
- /**
- * Decode message
- */
@Override
protected Object decode(
ChannelHandlerContext ctx, Channel channel, Object msg)
@@ -165,8 +162,11 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
// Status
if (type == MSG_GPS_LBS_STATUS) {
- int flags = buf.readUnsignedByte(); // TODO parse flags
extendedInfo.set("alarm", true);
+
+ int flags = buf.readUnsignedByte();
+ extendedInfo.set("acc", (flags & 0x2) != 0);
+ // TODO parse other flags
// Voltage
extendedInfo.set("power", buf.readUnsignedByte());