diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2014-10-04 15:46:46 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2014-10-04 15:46:46 +1300 |
commit | 0239489230ff7c9fc16d0dd8911123700b535b31 (patch) | |
tree | 7d439b6f94e6902def5209717cc62e843fd0c0e6 /src/org/traccar/protocol | |
parent | d2f79ef95411e7be309eb7e0fc6a0ec1b2227a7d (diff) | |
download | trackermap-server-0239489230ff7c9fc16d0dd8911123700b535b31.tar.gz trackermap-server-0239489230ff7c9fc16d0dd8911123700b535b31.tar.bz2 trackermap-server-0239489230ff7c9fc16d0dd8911123700b535b31.zip |
Extend GT06 protocol
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r-- | src/org/traccar/protocol/Gt06ProtocolDecoder.java | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java index 4b9aaedf3..44702924c 100644 --- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java @@ -61,11 +61,13 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { private static final int MSG_LOGIN = 0x01; private static final int MSG_GPS = 0x10; private static final int MSG_LBS = 0x11; - private static final int MSG_GPS_LBS = 0x12; + private static final int MSG_GPS_LBS_1 = 0x12; + private static final int MSG_GPS_LBS_2 = 0x22; private static final int MSG_STATUS = 0x13; private static final int MSG_SATELLITE = 0x14; private static final int MSG_STRING = 0x15; - private static final int MSG_GPS_LBS_STATUS = 0x16; + private static final int MSG_GPS_LBS_STATUS_1 = 0x16; + private static final int MSG_GPS_LBS_STATUS_2 = 0x26; private static final int MSG_LBS_PHONE = 0x17; private static final int MSG_LBS_EXTEND = 0x18; private static final int MSG_LBS_STATUS = 0x19; @@ -130,10 +132,12 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { } - else if (/*deviceId != null && */( + else if (deviceId != null && ( type == MSG_GPS || - type == MSG_GPS_LBS || - type == MSG_GPS_LBS_STATUS || + 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_PHONE || type == MSG_GPS_LBS_EXTEND)) { @@ -184,10 +188,11 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { buf.skipBytes(gpsLength - 12); // skip reserved - if (type == MSG_GPS_LBS || type == MSG_GPS_LBS_STATUS) { + if (type == MSG_GPS_LBS_1 || type == MSG_GPS_LBS_2 || + type == MSG_GPS_LBS_STATUS_1 || type == MSG_GPS_LBS_STATUS_2) { int lbsLength = 0; - if (type == MSG_GPS_LBS_STATUS) { + if (type == MSG_GPS_LBS_STATUS_1 || type == MSG_GPS_LBS_STATUS_2) { lbsLength = buf.readUnsignedByte(); } @@ -199,7 +204,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { buf.skipBytes(lbsLength - 9); // Status - if (type == MSG_GPS_LBS_STATUS) { + if (type == MSG_GPS_LBS_STATUS_1 || type == MSG_GPS_LBS_STATUS_2) { extendedInfo.set("alarm", true); int flags = buf.readUnsignedByte(); |