aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol
diff options
context:
space:
mode:
authorKevin Goos <kevingoos@telenet.be>2018-03-20 10:15:00 +0100
committerKevin Goos <kevingoos@telenet.be>2018-03-20 10:15:00 +0100
commit2ff1d912fad21a8b5014459300221171c3b836d2 (patch)
treecfcb4e78ddcded29aaf89499e575973b8fa47163 /src/org/traccar/protocol
parent2ce379a7ecf6c7b62673589d5c955727e22b2271 (diff)
downloadtrackermap-server-2ff1d912fad21a8b5014459300221171c3b836d2.tar.gz
trackermap-server-2ff1d912fad21a8b5014459300221171c3b836d2.tar.bz2
trackermap-server-2ff1d912fad21a8b5014459300221171c3b836d2.zip
Cleanup for cell info
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r--src/org/traccar/protocol/LaipacProtocolDecoder.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/LaipacProtocolDecoder.java b/src/org/traccar/protocol/LaipacProtocolDecoder.java
index 4fc0201ef..5221e46ad 100644
--- a/src/org/traccar/protocol/LaipacProtocolDecoder.java
+++ b/src/org/traccar/protocol/LaipacProtocolDecoder.java
@@ -22,6 +22,8 @@ import org.traccar.helper.Checksum;
import org.traccar.helper.DateBuilder;
import org.traccar.helper.Parser;
import org.traccar.helper.PatternBuilder;
+import org.traccar.model.CellTower;
+import org.traccar.model.Network;
import org.traccar.model.Position;
import java.net.SocketAddress;
@@ -120,9 +122,12 @@ public class LaipacProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.PREFIX_ADC + 1, parser.nextDouble() * 0.001);
position.set(Position.PREFIX_ADC + 2, parser.nextDouble() * 0.001);
- setNextValue(parser, position, Position.KEY_CELL_NET_CODE);
- setNextValue(parser, position, Position.KEY_CELL_ID_CODE);
- setNextValue(parser, position, Position.KEY_COUNTRY_CODE);
+ int cellNetCode = Integer.parseInt(parser.next(), 16);
+ Long cellId = Long.parseLong(parser.next(), 16);
+ int countryCode = parser.nextInt();
+
+ position.setNetwork(new Network(CellTower.from(countryCode, cellNetCode, 0, cellId)));
+
setNextValue(parser, position, Position.KEY_OPERATOR);
String checksum = parser.next();