diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2013-12-03 19:29:34 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2013-12-03 19:29:34 +1300 |
commit | 1208b77474498432364e03550a953962d2eac015 (patch) | |
tree | 96a0b7e32aaa6f4baeced6460b728d9747c84542 /src/org/traccar/protocol | |
parent | 1c70f6cad768f47ec8c49444e03691727699322b (diff) | |
download | traccar-server-1208b77474498432364e03550a953962d2eac015.tar.gz traccar-server-1208b77474498432364e03550a953962d2eac015.tar.bz2 traccar-server-1208b77474498432364e03550a953962d2eac015.zip |
Parse acc status (fix #470)
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r-- | src/org/traccar/protocol/Gt06ProtocolDecoder.java | 8 |
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()); |