From 1208b77474498432364e03550a953962d2eac015 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 3 Dec 2013 19:29:34 +1300 Subject: Parse acc status (fix #470) --- src/org/traccar/protocol/Gt06ProtocolDecoder.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/org/traccar') 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()); -- cgit v1.2.3