diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-12-15 01:36:22 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-12-15 01:36:22 +1300 |
commit | 1771c22baca9c43556e5cfc4ec705d0a071a78e8 (patch) | |
tree | 08e9357c3d822a5fc6b3d5bb99a411bb068b762e /src | |
parent | 0c8bf8867456c55231f2aabf36970504d4e8cab7 (diff) | |
download | trackermap-server-1771c22baca9c43556e5cfc4ec705d0a071a78e8.tar.gz trackermap-server-1771c22baca9c43556e5cfc4ec705d0a071a78e8.tar.bz2 trackermap-server-1771c22baca9c43556e5cfc4ec705d0a071a78e8.zip |
Fix GK310 A2 decoding
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/protocol/Gt06ProtocolDecoder.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java index 0fdd5ba10..adce11eab 100644 --- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java @@ -554,14 +554,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)); } } |