diff options
author | jon-stumpf <jon.stumpf@gmail.com> | 2017-02-20 19:47:07 -0500 |
---|---|---|
committer | jon-stumpf <jon.stumpf@gmail.com> | 2017-02-20 19:47:07 -0500 |
commit | 21d8146fc216df827c156b446221c2bc01f05a6f (patch) | |
tree | 63972b4df6d5d9180c5c65610bb8ea375d01b984 /src/org/traccar/protocol/AutoFonProtocolDecoder.java | |
parent | b67f1e828ce5bc8fe215d377cd2ae81f23152abd (diff) | |
download | trackermap-server-21d8146fc216df827c156b446221c2bc01f05a6f.tar.gz trackermap-server-21d8146fc216df827c156b446221c2bc01f05a6f.tar.bz2 trackermap-server-21d8146fc216df827c156b446221c2bc01f05a6f.zip |
Updated protocols to record CellTower information where appropriate; Removed KEY_RSSI when reported in CellTower;
Diffstat (limited to 'src/org/traccar/protocol/AutoFonProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/AutoFonProtocolDecoder.java | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/org/traccar/protocol/AutoFonProtocolDecoder.java b/src/org/traccar/protocol/AutoFonProtocolDecoder.java index d75ff2fe1..22a4dee42 100644 --- a/src/org/traccar/protocol/AutoFonProtocolDecoder.java +++ b/src/org/traccar/protocol/AutoFonProtocolDecoder.java @@ -23,6 +23,8 @@ import org.traccar.BaseProtocolDecoder; import org.traccar.DeviceSession; import org.traccar.helper.BitUtil; import org.traccar.helper.DateBuilder; +import org.traccar.model.CellTower; +import org.traccar.model.Network; import org.traccar.model.Position; import java.net.SocketAddress; @@ -84,11 +86,14 @@ public class AutoFonProtocolDecoder extends BaseProtocolDecoder { } position.set(Position.PREFIX_TEMP + 1, buf.readByte()); - position.set(Position.KEY_RSSI, buf.readUnsignedByte()); - buf.readUnsignedShort(); // mcc - buf.readUnsignedShort(); // mnc - buf.readUnsignedShort(); // lac - buf.readUnsignedShort(); // cid + + int rssi = buf.readUnsignedByte(); + CellTower cellTower = CellTower.from(buf.readUnsignedShort(), + buf.readUnsignedShort(), + buf.readUnsignedShort(), + buf.readUnsignedShort(), + rssi); + position.setNetwork(new Network(cellTower)); int valid = buf.readUnsignedByte(); position.setValid((valid & 0xc0) != 0); @@ -182,6 +187,7 @@ public class AutoFonProtocolDecoder extends BaseProtocolDecoder { buf.readByte(); // mode buf.readByte(); // gprs sending interval + // Should call position.setNetwork() here buf.skipBytes(6); // mcc, mnc, lac, cid int valid = buf.readUnsignedByte(); |