aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/AutoFonProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-02-26 14:59:02 +1300
committerGitHub <noreply@github.com>2017-02-26 14:59:02 +1300
commitaea5d9e8df58b37c937db87a272a9d92c64586f5 (patch)
treedda7693ba067874048c1a90c99b14e5ac75e77e8 /src/org/traccar/protocol/AutoFonProtocolDecoder.java
parente4aa15f0eb0646d6158fd8386f8f9c5477db6bfe (diff)
parent7152670b20a40de809db57ae21acb73c5ad5bea5 (diff)
downloadtrackermap-server-aea5d9e8df58b37c937db87a272a9d92c64586f5.tar.gz
trackermap-server-aea5d9e8df58b37c937db87a272a9d92c64586f5.tar.bz2
trackermap-server-aea5d9e8df58b37c937db87a272a9d92c64586f5.zip
Merge pull request #2951 from jon-stumpf/jss-celltower
CellTowers and capturing additional protocol information
Diffstat (limited to 'src/org/traccar/protocol/AutoFonProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/AutoFonProtocolDecoder.java16
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();