aboutsummaryrefslogtreecommitdiff
path: root/src/org
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
parent2ce379a7ecf6c7b62673589d5c955727e22b2271 (diff)
downloadtraccar-server-2ff1d912fad21a8b5014459300221171c3b836d2.tar.gz
traccar-server-2ff1d912fad21a8b5014459300221171c3b836d2.tar.bz2
traccar-server-2ff1d912fad21a8b5014459300221171c3b836d2.zip
Cleanup for cell info
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/model/Position.java4
-rw-r--r--src/org/traccar/protocol/LaipacProtocolDecoder.java11
2 files changed, 8 insertions, 7 deletions
diff --git a/src/org/traccar/model/Position.java b/src/org/traccar/model/Position.java
index 65bd03de6..fa303c500 100644
--- a/src/org/traccar/model/Position.java
+++ b/src/org/traccar/model/Position.java
@@ -88,10 +88,6 @@ public class Position extends Message {
public static final String KEY_DRIVER_UNIQUE_ID = "driverUniqueId";
- public static final String KEY_CELL_NET_CODE = "cellNetCode";
- public static final String KEY_CELL_ID_CODE = "cellIdCode";
- public static final String KEY_COUNTRY_CODE = "countryCode";
-
// Start with 1 not 0
public static final String PREFIX_TEMP = "temp";
public static final String PREFIX_ADC = "adc";
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();