aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/protocol/Gt06ProtocolDecoder.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
index 0fdd5ba10..37f64ee02 100644
--- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -118,6 +118,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
case MSG_GPS_LBS_EXTEND:
case MSG_GPS_2:
case MSG_FENCE_SINGLE:
+ case MSG_FENCE_MULTI:
return true;
default:
return false;
@@ -135,6 +136,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
case MSG_GPS_LBS_STATUS_3:
case MSG_GPS_2:
case MSG_FENCE_SINGLE:
+ case MSG_FENCE_MULTI:
case MSG_LBS_ALARM:
case MSG_LBS_ADDRESS:
return true;
@@ -554,14 +556,14 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
getLastLocation(position, dateBuilder.getDate());
int mcc = buf.readUnsignedShort();
- int mnc = buf.readUnsignedByte();
+ int mnc = BitUtil.check(mcc, 15) ? buf.readUnsignedShort() : buf.readUnsignedByte();
Network network = new Network();
for (int i = 0; i < 7; i++) {
int lac = longFormat ? buf.readInt() : buf.readUnsignedShort();
int cid = longFormat ? (int) buf.readLong() : buf.readUnsignedMedium();
int rssi = -buf.readUnsignedByte();
if (lac > 0) {
- network.addCellTower(CellTower.from(mcc, mnc, lac, cid, rssi));
+ network.addCellTower(CellTower.from(BitUtil.to(mcc, 15), mnc, lac, cid, rssi));
}
}
@@ -630,7 +632,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
buf.readUnsignedShort();
}
- if (type == MSG_GPS_LBS_STATUS_3) {
+ if (type == MSG_GPS_LBS_STATUS_3 || type == MSG_FENCE_MULTI) {
position.set(Position.KEY_GEOFENCE, buf.readUnsignedByte());
}