aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r--src/org/traccar/protocol/ApelProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/AquilaProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/AstraProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/AtrackProtocolDecoder.java6
-rw-r--r--src/org/traccar/protocol/AutoFonProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/Avl301ProtocolDecoder.java9
-rw-r--r--src/org/traccar/protocol/BceProtocolDecoder.java11
-rw-r--r--src/org/traccar/protocol/CalAmpProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/CarcellProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/CastelProtocolDecoder.java10
-rw-r--r--src/org/traccar/protocol/CguardProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/CityeasyProtocolDecoder.java8
-rw-r--r--src/org/traccar/protocol/CradlepointProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/DishaProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/EelinkProtocolDecoder.java16
-rw-r--r--src/org/traccar/protocol/FifotrackProtocolDecoder.java8
-rw-r--r--src/org/traccar/protocol/FlextrackProtocolDecoder.java14
-rw-r--r--src/org/traccar/protocol/Gl200ProtocolDecoder.java12
-rw-r--r--src/org/traccar/protocol/GoSafeProtocolDecoder.java8
-rw-r--r--src/org/traccar/protocol/Gps103ProtocolDecoder.java6
-rw-r--r--src/org/traccar/protocol/Gt02ProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/Gt06ProtocolDecoder.java66
-rw-r--r--src/org/traccar/protocol/H02ProtocolDecoder.java23
-rw-r--r--src/org/traccar/protocol/HaicomProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/IdplProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/JpKorjarProtocolDecoder.java8
-rw-r--r--src/org/traccar/protocol/Jt600ProtocolDecoder.java21
-rw-r--r--src/org/traccar/protocol/L100ProtocolDecoder.java11
-rw-r--r--src/org/traccar/protocol/MaestroProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/MegastekProtocolDecoder.java23
-rw-r--r--src/org/traccar/protocol/MeiligaoProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/MeitrackProtocolDecoder.java23
-rw-r--r--src/org/traccar/protocol/MiniFinderProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/Mta6ProtocolDecoder.java4
-rw-r--r--src/org/traccar/protocol/MxtProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/NavisProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/OigoProtocolDecoder.java4
-rw-r--r--src/org/traccar/protocol/ProgressProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/Pt502ProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/RaveonProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/T800xProtocolDecoder.java9
-rw-r--r--src/org/traccar/protocol/TeltonikaProtocolDecoder.java8
-rw-r--r--src/org/traccar/protocol/ThinkRaceProtocolDecoder.java6
-rw-r--r--src/org/traccar/protocol/Tk103ProtocolDecoder.java8
-rw-r--r--src/org/traccar/protocol/TotemProtocolDecoder.java17
-rw-r--r--src/org/traccar/protocol/Tr900ProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/TrvProtocolDecoder.java12
-rw-r--r--src/org/traccar/protocol/Tt8850ProtocolDecoder.java8
-rw-r--r--src/org/traccar/protocol/TytanProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/TzoneProtocolDecoder.java10
-rw-r--r--src/org/traccar/protocol/UlbotechProtocolDecoder.java14
-rw-r--r--src/org/traccar/protocol/UproProtocolDecoder.java15
-rw-r--r--src/org/traccar/protocol/V680ProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/VisiontekProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/WatchProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/XirgoProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/Xt013ProtocolDecoder.java2
57 files changed, 242 insertions, 210 deletions
diff --git a/src/org/traccar/protocol/ApelProtocolDecoder.java b/src/org/traccar/protocol/ApelProtocolDecoder.java
index aa58e478f..6e16e02be 100644
--- a/src/org/traccar/protocol/ApelProtocolDecoder.java
+++ b/src/org/traccar/protocol/ApelProtocolDecoder.java
@@ -175,7 +175,7 @@ public class ApelProtocolDecoder extends BaseProtocolDecoder {
if (subtype == MSG_STATE_FULL_INFO_T104) {
position.set(Position.KEY_SATELLITES, buf.readUnsignedByte());
- position.set(Position.KEY_GSM, buf.readUnsignedByte());
+ position.set(Position.KEY_RSSI, buf.readUnsignedByte());
position.set(Position.KEY_EVENT, buf.readUnsignedShort());
position.set(Position.KEY_ODOMETER, buf.readUnsignedInt());
position.set(Position.KEY_INPUT, buf.readUnsignedByte());
diff --git a/src/org/traccar/protocol/AquilaProtocolDecoder.java b/src/org/traccar/protocol/AquilaProtocolDecoder.java
index 1ce763463..60a9c4708 100644
--- a/src/org/traccar/protocol/AquilaProtocolDecoder.java
+++ b/src/org/traccar/protocol/AquilaProtocolDecoder.java
@@ -99,7 +99,7 @@ public class AquilaProtocolDecoder extends BaseProtocolDecoder {
position.setValid(parser.next().equals("A"));
- position.set(Position.KEY_GSM, parser.nextInt());
+ position.set(Position.KEY_RSSI, parser.nextInt());
position.setSpeed(UnitsConverter.knotsFromKph(parser.nextDouble()));
diff --git a/src/org/traccar/protocol/AstraProtocolDecoder.java b/src/org/traccar/protocol/AstraProtocolDecoder.java
index 390434d54..71f2080bb 100644
--- a/src/org/traccar/protocol/AstraProtocolDecoder.java
+++ b/src/org/traccar/protocol/AstraProtocolDecoder.java
@@ -100,7 +100,7 @@ public class AstraProtocolDecoder extends BaseProtocolDecoder {
int quality = buf.readUnsignedByte();
position.set(Position.KEY_SATELLITES, quality & 0xf);
- position.set(Position.KEY_GSM, quality >> 4);
+ position.set(Position.KEY_RSSI, quality >> 4);
buf.readUnsignedByte(); // geofence events
diff --git a/src/org/traccar/protocol/AtrackProtocolDecoder.java b/src/org/traccar/protocol/AtrackProtocolDecoder.java
index 9c34a2e78..8e3cd2089 100644
--- a/src/org/traccar/protocol/AtrackProtocolDecoder.java
+++ b/src/org/traccar/protocol/AtrackProtocolDecoder.java
@@ -93,13 +93,13 @@ public class AtrackProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_BATTERY, buf.readUnsignedShort());
break;
case "GQ":
- position.set(Position.KEY_GSM, buf.readUnsignedByte());
+ buf.readUnsignedByte(); // rssi
break;
case "CE":
- position.set(Position.KEY_CID, buf.readUnsignedInt());
+ buf.readUnsignedInt(); // cid
break;
case "LC":
- position.set(Position.KEY_LAC, buf.readUnsignedShort());
+ buf.readUnsignedShort(); // lac
break;
case "CN":
buf.readUnsignedInt(); // mcc + mnc
diff --git a/src/org/traccar/protocol/AutoFonProtocolDecoder.java b/src/org/traccar/protocol/AutoFonProtocolDecoder.java
index 1c618fdee..d75ff2fe1 100644
--- a/src/org/traccar/protocol/AutoFonProtocolDecoder.java
+++ b/src/org/traccar/protocol/AutoFonProtocolDecoder.java
@@ -84,7 +84,7 @@ public class AutoFonProtocolDecoder extends BaseProtocolDecoder {
}
position.set(Position.PREFIX_TEMP + 1, buf.readByte());
- position.set(Position.KEY_GSM, buf.readUnsignedByte());
+ position.set(Position.KEY_RSSI, buf.readUnsignedByte());
buf.readUnsignedShort(); // mcc
buf.readUnsignedShort(); // mnc
buf.readUnsignedShort(); // lac
diff --git a/src/org/traccar/protocol/Avl301ProtocolDecoder.java b/src/org/traccar/protocol/Avl301ProtocolDecoder.java
index cac6f717f..c19b96cb9 100644
--- a/src/org/traccar/protocol/Avl301ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Avl301ProtocolDecoder.java
@@ -21,6 +21,8 @@ import org.jboss.netty.channel.Channel;
import org.traccar.BaseProtocolDecoder;
import org.traccar.DeviceSession;
import org.traccar.helper.DateBuilder;
+import org.traccar.model.CellTower;
+import org.traccar.model.Network;
import org.traccar.model.Position;
import java.net.SocketAddress;
@@ -121,8 +123,9 @@ public class Avl301ProtocolDecoder extends BaseProtocolDecoder {
position.set("acc", (union & 0x8000) != 0);
}
- position.set(Position.KEY_LAC, buf.readUnsignedShort());
- position.set(Position.KEY_CID, buf.readUnsignedMedium());
+ position.setNetwork(new Network(
+ CellTower.fromLacCid(buf.readUnsignedShort(), buf.readUnsignedMedium())));
+
position.set(Position.KEY_ALARM, Position.ALARM_GENERAL);
int flags = buf.readUnsignedByte();
position.set("acc", (flags & 0x2) != 0);
@@ -130,7 +133,7 @@ public class Avl301ProtocolDecoder extends BaseProtocolDecoder {
// parse other flags
position.set(Position.KEY_POWER, buf.readUnsignedByte());
- position.set(Position.KEY_GSM, buf.readUnsignedByte());
+ position.set(Position.KEY_RSSI, buf.readUnsignedByte());
return position;
}
diff --git a/src/org/traccar/protocol/BceProtocolDecoder.java b/src/org/traccar/protocol/BceProtocolDecoder.java
index dace89659..06290d50d 100644
--- a/src/org/traccar/protocol/BceProtocolDecoder.java
+++ b/src/org/traccar/protocol/BceProtocolDecoder.java
@@ -21,6 +21,8 @@ import org.jboss.netty.channel.Channel;
import org.traccar.BaseProtocolDecoder;
import org.traccar.DeviceSession;
import org.traccar.helper.BitUtil;
+import org.traccar.model.CellTower;
+import org.traccar.model.Network;
import org.traccar.model.Position;
import java.net.SocketAddress;
@@ -128,11 +130,10 @@ public class BceProtocolDecoder extends BaseProtocolDecoder {
}
if (BitUtil.check(mask, 14)) {
- position.set(Position.KEY_MCC, buf.readUnsignedShort());
- position.set(Position.KEY_MNC, buf.readUnsignedByte());
- position.set(Position.KEY_LAC, buf.readUnsignedShort());
- position.set(Position.KEY_CID, buf.readUnsignedShort());
- position.set(Position.KEY_GSM, buf.readUnsignedByte());
+ position.setNetwork(new Network(CellTower.from(
+ buf.readUnsignedShort(), buf.readUnsignedByte(),
+ buf.readUnsignedShort(), buf.readUnsignedShort())));
+ position.set(Position.KEY_RSSI, buf.readUnsignedByte());
buf.readUnsignedByte();
}
diff --git a/src/org/traccar/protocol/CalAmpProtocolDecoder.java b/src/org/traccar/protocol/CalAmpProtocolDecoder.java
index ee4cc65b4..60b19ab06 100644
--- a/src/org/traccar/protocol/CalAmpProtocolDecoder.java
+++ b/src/org/traccar/protocol/CalAmpProtocolDecoder.java
@@ -95,7 +95,7 @@ public class CalAmpProtocolDecoder extends BaseProtocolDecoder {
if (type != MSG_MINI_EVENT_REPORT) {
position.set("carrier", buf.readUnsignedShort());
- position.set(Position.KEY_GSM, buf.readShort());
+ position.set(Position.KEY_RSSI, buf.readShort());
}
position.set("modem", buf.readUnsignedByte());
diff --git a/src/org/traccar/protocol/CarcellProtocolDecoder.java b/src/org/traccar/protocol/CarcellProtocolDecoder.java
index 5f5877852..23889a5bd 100644
--- a/src/org/traccar/protocol/CarcellProtocolDecoder.java
+++ b/src/org/traccar/protocol/CarcellProtocolDecoder.java
@@ -123,7 +123,7 @@ public class CarcellProtocolDecoder extends BaseProtocolDecoder {
Double internalBattery = (parser.nextDouble() + 100d) * 0.0294d;
position.set(Position.KEY_BATTERY, internalBattery);
- position.set(Position.KEY_GSM, parser.nextInt());
+ position.set(Position.KEY_RSSI, parser.nextInt());
position.set("jamming", parser.next().equals("1"));
position.set(Position.KEY_GPS, parser.nextInt());
diff --git a/src/org/traccar/protocol/CastelProtocolDecoder.java b/src/org/traccar/protocol/CastelProtocolDecoder.java
index 790dcd932..07d26f2b1 100644
--- a/src/org/traccar/protocol/CastelProtocolDecoder.java
+++ b/src/org/traccar/protocol/CastelProtocolDecoder.java
@@ -24,6 +24,8 @@ import org.traccar.helper.Checksum;
import org.traccar.helper.DateBuilder;
import org.traccar.helper.ObdDecoder;
import org.traccar.helper.UnitsConverter;
+import org.traccar.model.CellTower;
+import org.traccar.model.Network;
import org.traccar.model.Position;
import java.net.SocketAddress;
@@ -331,8 +333,8 @@ public class CastelProtocolDecoder extends BaseProtocolDecoder {
decodeStat(position, buf);
- position.set(Position.KEY_LAC, buf.readUnsignedShort());
- position.set(Position.KEY_CID, buf.readUnsignedShort());
+ position.setNetwork(new Network(
+ CellTower.fromLacCid(buf.readUnsignedShort(), buf.readUnsignedShort())));
return position;
@@ -366,8 +368,8 @@ public class CastelProtocolDecoder extends BaseProtocolDecoder {
buf.readUnsignedByte(); // geo-fencing flags
buf.readUnsignedByte(); // additional flags
- position.set(Position.KEY_LAC, buf.readUnsignedShort());
- position.set(Position.KEY_CID, buf.readUnsignedShort());
+ position.setNetwork(new Network(
+ CellTower.fromLacCid(buf.readUnsignedShort(), buf.readUnsignedShort())));
positions.add(position);
}
diff --git a/src/org/traccar/protocol/CguardProtocolDecoder.java b/src/org/traccar/protocol/CguardProtocolDecoder.java
index c5dc51d81..2fc3194db 100644
--- a/src/org/traccar/protocol/CguardProtocolDecoder.java
+++ b/src/org/traccar/protocol/CguardProtocolDecoder.java
@@ -104,7 +104,7 @@ public class CguardProtocolDecoder extends BaseProtocolDecoder {
String value = data[i * 2 + 1];
switch (key) {
case "CSQ1":
- position.set(Position.KEY_GSM, Integer.parseInt(value));
+ position.set(Position.KEY_RSSI, Integer.parseInt(value));
break;
case "NSQ1":
position.set(Position.KEY_SATELLITES, Integer.parseInt(value));
diff --git a/src/org/traccar/protocol/CityeasyProtocolDecoder.java b/src/org/traccar/protocol/CityeasyProtocolDecoder.java
index 9f2a0250d..2351232f9 100644
--- a/src/org/traccar/protocol/CityeasyProtocolDecoder.java
+++ b/src/org/traccar/protocol/CityeasyProtocolDecoder.java
@@ -24,6 +24,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;
@@ -117,10 +119,8 @@ public class CityeasyProtocolDecoder extends BaseProtocolDecoder {
}
- position.set(Position.KEY_MCC, parser.nextInt());
- position.set(Position.KEY_MNC, parser.nextInt());
- position.set(Position.KEY_LAC, parser.nextInt());
- position.set(Position.KEY_CID, parser.nextInt());
+ position.setNetwork(new Network(CellTower.from(
+ parser.nextInt(), parser.nextInt(), parser.nextInt(), parser.nextInt())));
return position;
}
diff --git a/src/org/traccar/protocol/CradlepointProtocolDecoder.java b/src/org/traccar/protocol/CradlepointProtocolDecoder.java
index f46459482..b9e1a3e86 100644
--- a/src/org/traccar/protocol/CradlepointProtocolDecoder.java
+++ b/src/org/traccar/protocol/CradlepointProtocolDecoder.java
@@ -81,7 +81,7 @@ public class CradlepointProtocolDecoder extends BaseProtocolDecoder {
parser.skip(4);
- position.set(Position.KEY_GSM, parser.next());
+ position.set(Position.KEY_RSSI, parser.next());
return position;
}
diff --git a/src/org/traccar/protocol/DishaProtocolDecoder.java b/src/org/traccar/protocol/DishaProtocolDecoder.java
index dc8bddd38..6b4f91833 100644
--- a/src/org/traccar/protocol/DishaProtocolDecoder.java
+++ b/src/org/traccar/protocol/DishaProtocolDecoder.java
@@ -90,7 +90,7 @@ public class DishaProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_SATELLITES, parser.next());
position.set(Position.KEY_HDOP, parser.next());
- position.set(Position.KEY_GSM, parser.next());
+ position.set(Position.KEY_RSSI, parser.next());
position.set(Position.KEY_CHARGE, parser.nextInt() == 2);
position.set(Position.KEY_BATTERY, parser.next());
diff --git a/src/org/traccar/protocol/EelinkProtocolDecoder.java b/src/org/traccar/protocol/EelinkProtocolDecoder.java
index 0bf7d229b..b1634042d 100644
--- a/src/org/traccar/protocol/EelinkProtocolDecoder.java
+++ b/src/org/traccar/protocol/EelinkProtocolDecoder.java
@@ -22,6 +22,8 @@ import org.traccar.BaseProtocolDecoder;
import org.traccar.DeviceSession;
import org.traccar.helper.BitUtil;
import org.traccar.helper.UnitsConverter;
+import org.traccar.model.CellTower;
+import org.traccar.model.Network;
import org.traccar.model.Position;
import java.net.SocketAddress;
@@ -108,10 +110,8 @@ public class EelinkProtocolDecoder extends BaseProtocolDecoder {
position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedByte()));
position.setCourse(buf.readUnsignedShort());
- position.set(Position.KEY_MCC, buf.readUnsignedShort());
- position.set(Position.KEY_MNC, buf.readUnsignedShort());
- position.set(Position.KEY_LAC, buf.readUnsignedShort());
- position.set(Position.KEY_CID, buf.readUnsignedMedium());
+ position.setNetwork(new Network(CellTower.from(
+ buf.readUnsignedShort(), buf.readUnsignedShort(), buf.readUnsignedShort(), buf.readUnsignedMedium())));
position.setValid((buf.readUnsignedByte() & 0x01) != 0);
@@ -148,11 +148,9 @@ public class EelinkProtocolDecoder extends BaseProtocolDecoder {
}
if (BitUtil.check(flags, 1)) {
- position.set(Position.KEY_MCC, buf.readUnsignedShort());
- position.set(Position.KEY_MNC, buf.readUnsignedShort());
- position.set(Position.KEY_LAC, buf.readUnsignedShort());
- position.set(Position.KEY_CID, buf.readUnsignedInt());
- position.set(Position.KEY_GSM, buf.readUnsignedByte());
+ position.setNetwork(new Network(CellTower.from(
+ buf.readUnsignedShort(), buf.readUnsignedShort(),
+ buf.readUnsignedShort(), buf.readUnsignedInt(), buf.readUnsignedByte())));
}
if (BitUtil.check(flags, 2)) {
diff --git a/src/org/traccar/protocol/FifotrackProtocolDecoder.java b/src/org/traccar/protocol/FifotrackProtocolDecoder.java
index 9243d1894..9ccc34384 100644
--- a/src/org/traccar/protocol/FifotrackProtocolDecoder.java
+++ b/src/org/traccar/protocol/FifotrackProtocolDecoder.java
@@ -22,6 +22,8 @@ import org.traccar.helper.DateBuilder;
import org.traccar.helper.Parser;
import org.traccar.helper.PatternBuilder;
import org.traccar.helper.UnitsConverter;
+import org.traccar.model.CellTower;
+import org.traccar.model.Network;
import org.traccar.model.Position;
import java.net.SocketAddress;
@@ -104,10 +106,8 @@ public class FifotrackProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_OUTPUT, parser.nextInt(16));
}
- position.set(Position.KEY_MCC, parser.nextInt());
- position.set(Position.KEY_MNC, parser.nextInt());
- position.set(Position.KEY_LAC, parser.nextInt(16));
- position.set(Position.KEY_CID, parser.nextInt(16));
+ position.setNetwork(new Network(CellTower.from(
+ parser.nextInt(), parser.nextInt(), parser.nextInt(16), parser.nextInt(16))));
String[] adc = parser.next().split("\\|");
for (int i = 0; i < adc.length; i++) {
diff --git a/src/org/traccar/protocol/FlextrackProtocolDecoder.java b/src/org/traccar/protocol/FlextrackProtocolDecoder.java
index db85acd5d..39da99fda 100644
--- a/src/org/traccar/protocol/FlextrackProtocolDecoder.java
+++ b/src/org/traccar/protocol/FlextrackProtocolDecoder.java
@@ -22,6 +22,8 @@ import org.traccar.helper.DateBuilder;
import org.traccar.helper.Parser;
import org.traccar.helper.PatternBuilder;
import org.traccar.helper.UnitsConverter;
+import org.traccar.model.CellTower;
+import org.traccar.model.Network;
import org.traccar.model.Position;
import java.net.SocketAddress;
@@ -121,16 +123,18 @@ public class FlextrackProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_SATELLITES, parser.nextInt());
position.set(Position.KEY_BATTERY, parser.nextInt());
- position.set(Position.KEY_GSM, parser.nextInt());
+ position.set(Position.KEY_RSSI, parser.nextInt());
position.set(Position.KEY_STATUS, parser.nextInt(16));
- position.set(Position.KEY_MCC, parser.nextInt());
- position.set(Position.KEY_MNC, parser.nextInt());
+
+ int mcc = parser.nextInt();
+ int mnc = parser.nextInt();
position.setAltitude(parser.nextInt());
position.set(Position.KEY_HDOP, parser.nextInt() * 0.1);
- position.set(Position.KEY_CID, parser.nextInt(16));
- position.set(Position.KEY_LAC, parser.nextInt(16));
+
+ position.setNetwork(new Network(CellTower.from(mcc, mnc, parser.nextInt(16), parser.nextInt(16))));
+
position.set(Position.KEY_ODOMETER, parser.nextInt());
return position;
diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java
index 66a4e2f7e..769964f33 100644
--- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java
@@ -24,6 +24,8 @@ import org.traccar.helper.DateBuilder;
import org.traccar.helper.Parser;
import org.traccar.helper.PatternBuilder;
import org.traccar.helper.UnitsConverter;
+import org.traccar.model.CellTower;
+import org.traccar.model.Network;
import org.traccar.model.Position;
import java.net.SocketAddress;
@@ -324,7 +326,9 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_BATTERY, parser.nextDouble());
position.set(Position.KEY_CHARGE, parser.nextInt() == 1);
- parser.next(); // battery percentage
+ if (parser.hasNext()) {
+ position.set(Position.KEY_BATTERY, parser.next() + "%");
+ }
position.set(Position.PREFIX_TEMP + 1, parser.next());
@@ -392,10 +396,8 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
}
if (parser.hasNext(4)) {
- position.set(Position.KEY_MCC, parser.nextInt());
- position.set(Position.KEY_MNC, parser.nextInt());
- position.set(Position.KEY_LAC, parser.nextInt(16));
- position.set(Position.KEY_CID, parser.nextInt(16));
+ position.setNetwork(new Network(CellTower.from(
+ parser.nextInt(), parser.nextInt(), parser.nextInt(16), parser.nextInt(16))));
}
parser.skip(4); // alternative networks
diff --git a/src/org/traccar/protocol/GoSafeProtocolDecoder.java b/src/org/traccar/protocol/GoSafeProtocolDecoder.java
index a7f1024c6..40a0d4d73 100644
--- a/src/org/traccar/protocol/GoSafeProtocolDecoder.java
+++ b/src/org/traccar/protocol/GoSafeProtocolDecoder.java
@@ -23,6 +23,8 @@ import org.traccar.helper.DateBuilder;
import org.traccar.helper.Parser;
import org.traccar.helper.PatternBuilder;
import org.traccar.helper.UnitsConverter;
+import org.traccar.model.CellTower;
+import org.traccar.model.Network;
import org.traccar.model.Position;
import java.net.SocketAddress;
@@ -155,10 +157,8 @@ public class GoSafeProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_HDOP, parser.next());
if (parser.hasNext(4)) {
- position.set(Position.KEY_MCC, parser.nextInt());
- position.set(Position.KEY_MNC, parser.nextInt());
- position.set(Position.KEY_LAC, parser.nextInt(16));
- position.set(Position.KEY_CID, parser.nextInt(16));
+ position.setNetwork(new Network(CellTower.from(
+ parser.nextInt(), parser.nextInt(), parser.nextInt(16), parser.nextInt(16))));
}
if (parser.hasNext()) {
position.set(Position.KEY_ODOMETER, parser.nextInt());
diff --git a/src/org/traccar/protocol/Gps103ProtocolDecoder.java b/src/org/traccar/protocol/Gps103ProtocolDecoder.java
index d929ae917..0320f785f 100644
--- a/src/org/traccar/protocol/Gps103ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gps103ProtocolDecoder.java
@@ -21,6 +21,8 @@ import org.traccar.DeviceSession;
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;
@@ -171,8 +173,8 @@ public class Gps103ProtocolDecoder extends BaseProtocolDecoder {
getLastLocation(position, null);
- position.set(Position.KEY_LAC, parser.nextInt(16));
- position.set(Position.KEY_CID, parser.nextInt(16));
+ position.setNetwork(new Network(
+ CellTower.fromLacCid(parser.nextInt(16), parser.nextInt(16))));
return position;
diff --git a/src/org/traccar/protocol/Gt02ProtocolDecoder.java b/src/org/traccar/protocol/Gt02ProtocolDecoder.java
index 8a42293b9..a520bff13 100644
--- a/src/org/traccar/protocol/Gt02ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gt02ProtocolDecoder.java
@@ -70,7 +70,7 @@ public class Gt02ProtocolDecoder extends BaseProtocolDecoder {
getLastLocation(position, null);
position.set(Position.KEY_POWER, power);
- position.set(Position.KEY_GSM, gsm);
+ position.set(Position.KEY_RSSI, gsm);
if (channel != null) {
byte[] response = {0x54, 0x68, 0x1A, 0x0D, 0x0A};
diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
index 35cb83dac..356097fb2 100644
--- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -25,6 +25,8 @@ import org.traccar.helper.BitUtil;
import org.traccar.helper.Checksum;
import org.traccar.helper.DateBuilder;
import org.traccar.helper.UnitsConverter;
+import org.traccar.model.CellTower;
+import org.traccar.model.Network;
import org.traccar.model.Position;
import java.net.SocketAddress;
@@ -142,10 +144,8 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
lbsLength = buf.readUnsignedByte();
}
- position.set(Position.KEY_MCC, buf.readUnsignedShort());
- position.set(Position.KEY_MNC, buf.readUnsignedByte());
- position.set(Position.KEY_LAC, buf.readUnsignedShort());
- position.set(Position.KEY_CID, buf.readUnsignedMedium());
+ position.setNetwork(new Network(CellTower.from(
+ buf.readUnsignedShort(), buf.readUnsignedByte(), buf.readUnsignedShort(), buf.readUnsignedMedium())));
if (lbsLength > 0) {
buf.skipBytes(lbsLength - 9);
@@ -159,7 +159,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_IGNITION, BitUtil.check(flags, 1));
position.set(Position.KEY_STATUS, flags);
position.set(Position.KEY_BATTERY, buf.readUnsignedByte());
- position.set(Position.KEY_GSM, buf.readUnsignedByte());
+ position.set(Position.KEY_RSSI, buf.readUnsignedByte());
position.set(Position.KEY_ALARM, decodeAlarm(buf.readUnsignedByte()));
}
@@ -222,8 +222,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
}
}
- DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, imei);
- if (deviceSession != null) {
+ if (getDeviceSession(channel, remoteAddress, imei) != null) {
buf.skipBytes(buf.readableBytes() - 6);
sendResponse(channel, type, buf.readUnsignedShort());
}
@@ -235,11 +234,29 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
return null;
}
- if (type == MSG_STRING) {
+ Position position = new Position();
+ position.setDeviceId(deviceSession.getDeviceId());
+ position.setProtocol(getProtocolName());
+
+ if (type == MSG_LBS_EXTEND) {
+
+ DateBuilder dateBuilder = new DateBuilder(timeZone)
+ .setDate(buf.readUnsignedByte(), buf.readUnsignedByte(), buf.readUnsignedByte())
+ .setTime(buf.readUnsignedByte(), buf.readUnsignedByte(), buf.readUnsignedByte());
+
+ getLastLocation(position, dateBuilder.getDate());
- Position position = new Position();
- position.setDeviceId(deviceSession.getDeviceId());
- position.setProtocol(getProtocolName());
+ int mcc = buf.readUnsignedShort();
+ int mnc = buf.readUnsignedByte();
+
+ Network network = new Network();
+ for (int i = 0; i < 7; i++) {
+ network.addCellTower(CellTower.from(
+ mcc, mnc, buf.readUnsignedShort(), buf.readUnsignedMedium(), -buf.readUnsignedByte()));
+ }
+ position.setNetwork(network);
+
+ } else if (type == MSG_STRING) {
getLastLocation(position, null);
@@ -250,18 +267,8 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
position.set("command", buf.readBytes(commandLength - 1).toString(StandardCharsets.US_ASCII));
}
- buf.readUnsignedShort(); // language
-
- sendResponse(channel, type, buf.readUnsignedShort());
-
- return position;
-
} else if (isSupported(type)) {
- Position position = new Position();
- position.setDeviceId(deviceSession.getDeviceId());
- position.setProtocol(getProtocolName());
-
if (hasGps(type)) {
decodeGps(position, buf);
} else {
@@ -280,23 +287,22 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_ODOMETER, buf.readUnsignedInt());
}
- if (buf.readableBytes() > 6) {
- buf.skipBytes(buf.readableBytes() - 6);
- }
- int index = buf.readUnsignedShort();
- position.set(Position.KEY_INDEX, index);
- sendResponse(channel, type, index);
-
- return position;
-
} else {
buf.skipBytes(dataLength);
if (type != MSG_COMMAND_0 && type != MSG_COMMAND_1 && type != MSG_COMMAND_2) {
sendResponse(channel, type, buf.readUnsignedShort());
}
+ return null;
+
+ }
+ if (buf.readableBytes() > 6) {
+ buf.skipBytes(buf.readableBytes() - 6);
}
+ sendResponse(channel, type, buf.readUnsignedShort());
+
+ return position;
}
diff --git a/src/org/traccar/protocol/H02ProtocolDecoder.java b/src/org/traccar/protocol/H02ProtocolDecoder.java
index 2c7852d16..431dd5c3c 100644
--- a/src/org/traccar/protocol/H02ProtocolDecoder.java
+++ b/src/org/traccar/protocol/H02ProtocolDecoder.java
@@ -25,6 +25,8 @@ import org.traccar.helper.BitUtil;
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;
@@ -249,10 +251,7 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder {
int lac = parser.nextInt(16);
int cid = parser.nextInt(16);
if (mcc != 0 && mnc != 0 && lac != 0 && cid != 0) {
- position.set(Position.KEY_MCC, mcc);
- position.set(Position.KEY_MNC, mnc);
- position.set(Position.KEY_LAC, lac);
- position.set(Position.KEY_CID, cid);
+ position.setNetwork(new Network(CellTower.from(mcc, mnc, lac, cid)));
}
}
@@ -278,13 +277,17 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder {
DateBuilder dateBuilder = new DateBuilder()
.setTime(parser.nextInt(), parser.nextInt(), parser.nextInt());
- position.set(Position.KEY_MCC, parser.nextInt());
- position.set(Position.KEY_MNC, parser.nextInt());
+ Network network = new Network();
+ int mcc = parser.nextInt();
+ int mnc = parser.nextInt();
- String[] cells = parser.next().split(","); // decode all in future
- position.set(Position.KEY_LAC, Integer.parseInt(cells[0]));
- position.set(Position.KEY_CID, Integer.parseInt(cells[1]));
- position.set(Position.KEY_GSM, Integer.parseInt(cells[2]));
+ String[] cells = parser.next().split(",");
+ for (int i = 0; i < cells.length / 3; i++) {
+ network.addCellTower(CellTower.from(mcc, mnc, Integer.parseInt(cells[i * 3]),
+ Integer.parseInt(cells[i * 3 + 1]), Integer.parseInt(cells[i * 3 + 2])));
+ }
+
+ position.setNetwork(network);
dateBuilder.setDateReverse(parser.nextInt(), parser.nextInt(), parser.nextInt());
diff --git a/src/org/traccar/protocol/HaicomProtocolDecoder.java b/src/org/traccar/protocol/HaicomProtocolDecoder.java
index 8fbf98d3c..7cd0b37f2 100644
--- a/src/org/traccar/protocol/HaicomProtocolDecoder.java
+++ b/src/org/traccar/protocol/HaicomProtocolDecoder.java
@@ -101,7 +101,7 @@ public class HaicomProtocolDecoder extends BaseProtocolDecoder {
position.setCourse(parser.nextDouble() / 10);
position.set(Position.KEY_STATUS, parser.next());
- position.set(Position.KEY_GSM, parser.next());
+ position.set(Position.KEY_RSSI, parser.next());
position.set(Position.KEY_GPS, parser.next());
position.set(Position.KEY_INPUT, parser.next());
position.set(Position.KEY_OUTPUT, parser.next());
diff --git a/src/org/traccar/protocol/IdplProtocolDecoder.java b/src/org/traccar/protocol/IdplProtocolDecoder.java
index cfef75952..09a3db9bd 100644
--- a/src/org/traccar/protocol/IdplProtocolDecoder.java
+++ b/src/org/traccar/protocol/IdplProtocolDecoder.java
@@ -93,7 +93,7 @@ public class IdplProtocolDecoder extends BaseProtocolDecoder {
position.setCourse(parser.nextDouble());
position.set(Position.KEY_SATELLITES, parser.nextInt());
- position.set(Position.KEY_GSM, parser.nextInt());
+ position.set(Position.KEY_RSSI, parser.nextInt());
parser.next(); // vehicle status
position.set(Position.KEY_POWER, parser.nextInt());
position.set(Position.KEY_BATTERY, parser.nextDouble());
diff --git a/src/org/traccar/protocol/JpKorjarProtocolDecoder.java b/src/org/traccar/protocol/JpKorjarProtocolDecoder.java
index debc66673..60aadd025 100644
--- a/src/org/traccar/protocol/JpKorjarProtocolDecoder.java
+++ b/src/org/traccar/protocol/JpKorjarProtocolDecoder.java
@@ -22,6 +22,8 @@ import org.traccar.DeviceSession;
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;
@@ -82,10 +84,8 @@ public class JpKorjarProtocolDecoder extends BaseProtocolDecoder {
position.setValid(parser.nextInt() == 1);
- position.set(Position.KEY_MCC, parser.nextInt());
- position.set(Position.KEY_MNC, parser.nextInt());
- position.set(Position.KEY_LAC, parser.nextInt(16));
- position.set(Position.KEY_CID, parser.nextInt(16));
+ position.setNetwork(new Network(CellTower.from(
+ parser.nextInt(), parser.nextInt(), parser.nextInt(16), parser.nextInt(16))));
return position;
}
diff --git a/src/org/traccar/protocol/Jt600ProtocolDecoder.java b/src/org/traccar/protocol/Jt600ProtocolDecoder.java
index ad7a00dc2..0d8b4abbc 100644
--- a/src/org/traccar/protocol/Jt600ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Jt600ProtocolDecoder.java
@@ -25,6 +25,8 @@ import org.traccar.helper.DateBuilder;
import org.traccar.helper.Parser;
import org.traccar.helper.PatternBuilder;
import org.traccar.helper.UnitsConverter;
+import org.traccar.model.CellTower;
+import org.traccar.model.Network;
import org.traccar.model.Position;
import java.net.SocketAddress;
@@ -108,9 +110,10 @@ public class Jt600ProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_BATTERY, battery + "%");
}
- position.set(Position.KEY_CID, buf.readUnsignedShort());
- position.set(Position.KEY_LAC, buf.readUnsignedShort());
- position.set(Position.KEY_GSM, buf.readUnsignedByte());
+ position.setNetwork(new Network(
+ CellTower.fromCidLac(buf.readUnsignedShort(), buf.readUnsignedShort())));
+
+ position.set(Position.KEY_RSSI, buf.readUnsignedByte());
position.set(Position.KEY_INDEX, buf.readUnsignedByte());
} else if (version == 1) {
@@ -125,11 +128,10 @@ public class Jt600ProtocolDecoder extends BaseProtocolDecoder {
int cid = buf.readUnsignedShort();
int lac = buf.readUnsignedShort();
if (cid != 0 && lac != 0) {
- position.set(Position.KEY_CID, cid);
- position.set(Position.KEY_LAC, lac);
+ position.setNetwork(new Network(CellTower.fromCidLac(cid, lac)));
}
- position.set(Position.KEY_GSM, buf.readUnsignedByte());
+ position.set(Position.KEY_RSSI, buf.readUnsignedByte());
} else if (version == 2) {
@@ -256,9 +258,10 @@ public class Jt600ProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_SATELLITES, parser.nextInt());
position.set(Position.KEY_BATTERY, parser.next());
position.set(Position.KEY_STATUS, parser.nextInt(2));
- position.set(Position.KEY_CID, parser.nextInt());
- position.set(Position.KEY_LAC, parser.nextInt());
- position.set(Position.KEY_GSM, parser.nextInt());
+
+ position.setNetwork(new Network(CellTower.fromCidLac(parser.nextInt(), parser.nextInt())));
+
+ position.set(Position.KEY_RSSI, parser.nextInt());
position.set(Position.KEY_ODOMETER, parser.nextLong() * 1000);
position.set(Position.KEY_INDEX, parser.nextInt());
diff --git a/src/org/traccar/protocol/L100ProtocolDecoder.java b/src/org/traccar/protocol/L100ProtocolDecoder.java
index 7eed7df9a..bdf4ba29b 100644
--- a/src/org/traccar/protocol/L100ProtocolDecoder.java
+++ b/src/org/traccar/protocol/L100ProtocolDecoder.java
@@ -22,6 +22,8 @@ import org.traccar.DeviceSession;
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;
@@ -106,11 +108,10 @@ public class L100ProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_ODOMETER, parser.nextDouble());
position.set(Position.PREFIX_TEMP + 1, parser.nextDouble());
position.set(Position.KEY_BATTERY, parser.nextDouble());
- position.set(Position.KEY_GSM, parser.nextInt());
- position.set(Position.KEY_MCC, parser.nextInt());
- position.set(Position.KEY_MNC, parser.nextInt());
- position.set(Position.KEY_LAC, parser.nextInt());
- position.set(Position.KEY_CID, parser.nextInt());
+
+ int rssi = parser.nextInt();
+ position.setNetwork(new Network(CellTower.from(
+ parser.nextInt(), parser.nextInt(), parser.nextInt(), parser.nextInt(), rssi)));
return position;
}
diff --git a/src/org/traccar/protocol/MaestroProtocolDecoder.java b/src/org/traccar/protocol/MaestroProtocolDecoder.java
index 06ec2473d..f0b328cf9 100644
--- a/src/org/traccar/protocol/MaestroProtocolDecoder.java
+++ b/src/org/traccar/protocol/MaestroProtocolDecoder.java
@@ -78,7 +78,7 @@ public class MaestroProtocolDecoder extends BaseProtocolDecoder {
position.setValid(parser.nextInt() == 1);
position.set(Position.KEY_BATTERY, parser.nextDouble());
- position.set(Position.KEY_GSM, parser.nextInt());
+ position.set(Position.KEY_RSSI, parser.nextInt());
position.set(Position.KEY_CHARGE, parser.nextInt() == 1);
position.set(Position.KEY_IGNITION, parser.nextInt() == 1);
diff --git a/src/org/traccar/protocol/MegastekProtocolDecoder.java b/src/org/traccar/protocol/MegastekProtocolDecoder.java
index 005d38c41..60660adf6 100644
--- a/src/org/traccar/protocol/MegastekProtocolDecoder.java
+++ b/src/org/traccar/protocol/MegastekProtocolDecoder.java
@@ -21,6 +21,8 @@ import org.traccar.DeviceSession;
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;
@@ -176,10 +178,8 @@ public class MegastekProtocolDecoder extends BaseProtocolDecoder {
}
if (parser.hasNext(4)) {
- position.set(Position.KEY_MCC, parser.nextInt());
- position.set(Position.KEY_MNC, parser.nextInt());
- position.set(Position.KEY_LAC, parser.nextInt(16));
- position.set(Position.KEY_CID, parser.nextInt(16));
+ position.setNetwork(new Network(CellTower.from(
+ parser.nextInt(), parser.nextInt(), parser.nextInt(16), parser.nextInt(16))));
}
} else {
@@ -203,11 +203,8 @@ public class MegastekProtocolDecoder extends BaseProtocolDecoder {
}
position.setDeviceId(deviceSession.getDeviceId());
- position.set(Position.KEY_MCC, parser.nextInt());
- position.set(Position.KEY_MNC, parser.nextInt());
- position.set(Position.KEY_LAC, parser.nextInt(16));
- position.set(Position.KEY_CID, parser.nextInt(16));
- position.set(Position.KEY_GSM, parser.next());
+ position.setNetwork(new Network(CellTower.from(
+ parser.nextInt(), parser.nextInt(), parser.nextInt(16), parser.nextInt(16), parser.nextInt())));
position.set(Position.KEY_BATTERY, Double.parseDouble(parser.next()));
@@ -310,11 +307,9 @@ public class MegastekProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1000);
}
- position.set(Position.KEY_MCC, parser.nextInt());
- position.set(Position.KEY_MNC, parser.nextInt());
- position.set(Position.KEY_LAC, parser.nextInt(16));
- position.set(Position.KEY_CID, parser.nextInt(16));
- position.set(Position.KEY_GSM, parser.nextInt());
+ position.setNetwork(new Network(CellTower.from(
+ parser.nextInt(), parser.nextInt(), parser.nextInt(16), parser.nextInt(16), parser.nextInt())));
+
position.set(Position.KEY_INPUT, parser.nextInt(2));
position.set(Position.KEY_OUTPUT, parser.nextInt(2));
diff --git a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
index 74b7c0e52..6408154e3 100644
--- a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
+++ b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
@@ -245,7 +245,7 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder {
}
if (parser.hasNext()) {
- position.set(Position.KEY_GSM, parser.nextInt(16));
+ position.set(Position.KEY_RSSI, parser.nextInt(16));
}
if (parser.hasNext()) {
diff --git a/src/org/traccar/protocol/MeitrackProtocolDecoder.java b/src/org/traccar/protocol/MeitrackProtocolDecoder.java
index 72ccaa037..7b4e38fe6 100644
--- a/src/org/traccar/protocol/MeitrackProtocolDecoder.java
+++ b/src/org/traccar/protocol/MeitrackProtocolDecoder.java
@@ -24,6 +24,8 @@ import org.traccar.helper.DateBuilder;
import org.traccar.helper.Parser;
import org.traccar.helper.PatternBuilder;
import org.traccar.helper.UnitsConverter;
+import org.traccar.model.CellTower;
+import org.traccar.model.Network;
import org.traccar.model.Position;
import java.net.SocketAddress;
@@ -113,7 +115,7 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder {
position.setValid(parser.next().equals("A"));
position.set(Position.KEY_SATELLITES, parser.next());
- position.set(Position.KEY_GSM, parser.next());
+ position.set(Position.KEY_RSSI, parser.next());
position.setSpeed(UnitsConverter.knotsFromKph(parser.nextDouble()));
position.setCourse(parser.nextDouble());
@@ -124,10 +126,10 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_ODOMETER, parser.next());
position.set("runtime", parser.next());
- position.set(Position.KEY_MCC, parser.nextInt());
- position.set(Position.KEY_MNC, parser.nextInt());
- position.set(Position.KEY_LAC, parser.nextInt(16));
- position.set(Position.KEY_CID, parser.nextInt(16));
+
+ position.setNetwork(new Network(
+ CellTower.from(parser.nextInt(), parser.nextInt(), parser.nextInt(16), parser.nextInt(16))));
+
position.set(Position.KEY_STATUS, parser.next());
for (int i = 1; i <= 3; i++) {
@@ -198,7 +200,7 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder {
position.setValid(buf.readUnsignedByte() == 1);
position.set(Position.KEY_SATELLITES, buf.readUnsignedByte());
- position.set(Position.KEY_GSM, buf.readUnsignedByte());
+ position.set(Position.KEY_RSSI, buf.readUnsignedByte());
position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedShort()));
position.setCourse(buf.readUnsignedShort());
@@ -209,10 +211,11 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_ODOMETER, buf.readUnsignedInt());
position.set("runtime", buf.readUnsignedInt());
- position.set(Position.KEY_MCC, buf.readUnsignedShort());
- position.set(Position.KEY_MNC, buf.readUnsignedShort());
- position.set(Position.KEY_LAC, buf.readUnsignedShort());
- position.set(Position.KEY_CID, buf.readUnsignedShort());
+
+ position.setNetwork(new Network(CellTower.from(
+ buf.readUnsignedShort(), buf.readUnsignedShort(),
+ buf.readUnsignedShort(), buf.readUnsignedShort())));
+
position.set(Position.KEY_STATUS, buf.readUnsignedShort());
position.set(Position.PREFIX_ADC + 1, buf.readUnsignedShort());
diff --git a/src/org/traccar/protocol/MiniFinderProtocolDecoder.java b/src/org/traccar/protocol/MiniFinderProtocolDecoder.java
index da03dc8bf..360df726a 100644
--- a/src/org/traccar/protocol/MiniFinderProtocolDecoder.java
+++ b/src/org/traccar/protocol/MiniFinderProtocolDecoder.java
@@ -122,7 +122,7 @@ public class MiniFinderProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_ALARM, Position.ALARM_MOVEMENT);
}
- position.set(Position.KEY_GSM, BitUtil.between(flags, 16, 20));
+ position.set(Position.KEY_RSSI, BitUtil.between(flags, 16, 20));
position.set(Position.KEY_CHARGE, BitUtil.check(flags, 22));
position.setAltitude(parser.nextDouble());
diff --git a/src/org/traccar/protocol/Mta6ProtocolDecoder.java b/src/org/traccar/protocol/Mta6ProtocolDecoder.java
index 2109a63c3..2a3d84a2c 100644
--- a/src/org/traccar/protocol/Mta6ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Mta6ProtocolDecoder.java
@@ -184,7 +184,7 @@ public class Mta6ProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_POWER, buf.readUnsignedShort() & 0x03ff);
buf.readByte(); // microcontroller temperature
- position.set(Position.KEY_GSM, (buf.getUnsignedByte(buf.readerIndex()) >> 4) & 0x07);
+ position.set(Position.KEY_RSSI, (buf.getUnsignedByte(buf.readerIndex()) >> 4) & 0x07);
int satellites = buf.readUnsignedByte() & 0x0f;
position.setValid(satellites >= 3);
@@ -263,7 +263,7 @@ public class Mta6ProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_POWER, buf.readUnsignedShort() & 0x03ff);
buf.readByte(); // microcontroller temperature
- position.set(Position.KEY_GSM, buf.getUnsignedByte(buf.readerIndex()) >> 5);
+ position.set(Position.KEY_RSSI, buf.getUnsignedByte(buf.readerIndex()) >> 5);
int satellites = buf.readUnsignedByte() & 0x1f;
position.setValid(satellites >= 3);
diff --git a/src/org/traccar/protocol/MxtProtocolDecoder.java b/src/org/traccar/protocol/MxtProtocolDecoder.java
index 0e01f807f..c03305c1a 100644
--- a/src/org/traccar/protocol/MxtProtocolDecoder.java
+++ b/src/org/traccar/protocol/MxtProtocolDecoder.java
@@ -107,7 +107,7 @@ public class MxtProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_SATELLITES, buf.readUnsignedByte());
position.set(Position.KEY_HDOP, buf.readUnsignedByte());
buf.readUnsignedByte(); // GPS accuracy
- position.set(Position.KEY_GSM, buf.readUnsignedByte());
+ position.set(Position.KEY_RSSI, buf.readUnsignedByte());
buf.readUnsignedShort(); // time since boot
buf.readUnsignedByte(); // input voltage
position.set(Position.PREFIX_TEMP + 1, buf.readByte());
diff --git a/src/org/traccar/protocol/NavisProtocolDecoder.java b/src/org/traccar/protocol/NavisProtocolDecoder.java
index e06ef1b57..8d4e367ab 100644
--- a/src/org/traccar/protocol/NavisProtocolDecoder.java
+++ b/src/org/traccar/protocol/NavisProtocolDecoder.java
@@ -102,7 +102,7 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_ALARM, Position.ALARM_GENERAL);
}
position.set(Position.KEY_STATUS, buf.readUnsignedByte());
- position.set(Position.KEY_GSM, buf.readUnsignedByte());
+ position.set(Position.KEY_RSSI, buf.readUnsignedByte());
if (isFormat(format, F10, F20, F30)) {
position.set(Position.KEY_OUTPUT, buf.readUnsignedShort());
diff --git a/src/org/traccar/protocol/OigoProtocolDecoder.java b/src/org/traccar/protocol/OigoProtocolDecoder.java
index 9e6a9a82e..d10f754e9 100644
--- a/src/org/traccar/protocol/OigoProtocolDecoder.java
+++ b/src/org/traccar/protocol/OigoProtocolDecoder.java
@@ -117,7 +117,7 @@ public class OigoProtocolDecoder extends BaseProtocolDecoder {
}
if (BitUtil.check(mask, 8)) {
- position.set(Position.KEY_GSM, buf.readUnsignedByte());
+ position.set(Position.KEY_RSSI, buf.readUnsignedByte());
}
if (BitUtil.check(mask, 9)) {
@@ -204,7 +204,7 @@ public class OigoProtocolDecoder extends BaseProtocolDecoder {
dateBuilder.setSecond(buf.readUnsignedByte());
position.setTime(dateBuilder.getDate());
- position.set(Position.KEY_GSM, buf.readUnsignedByte());
+ position.set(Position.KEY_RSSI, buf.readUnsignedByte());
int index = buf.readUnsignedByte();
diff --git a/src/org/traccar/protocol/ProgressProtocolDecoder.java b/src/org/traccar/protocol/ProgressProtocolDecoder.java
index 9e24efc38..1820ea926 100644
--- a/src/org/traccar/protocol/ProgressProtocolDecoder.java
+++ b/src/org/traccar/protocol/ProgressProtocolDecoder.java
@@ -127,7 +127,7 @@ public class ProgressProtocolDecoder extends BaseProtocolDecoder {
position.setValid(satellites >= 3);
position.set(Position.KEY_SATELLITES, satellites);
- position.set(Position.KEY_GSM, buf.readUnsignedByte());
+ position.set(Position.KEY_RSSI, buf.readUnsignedByte());
position.set(Position.KEY_ODOMETER, buf.readUnsignedInt());
long extraFlags = buf.readLong();
diff --git a/src/org/traccar/protocol/Pt502ProtocolDecoder.java b/src/org/traccar/protocol/Pt502ProtocolDecoder.java
index f3d9e8380..54f54d392 100644
--- a/src/org/traccar/protocol/Pt502ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Pt502ProtocolDecoder.java
@@ -136,7 +136,7 @@ public class Pt502ProtocolDecoder extends BaseProtocolDecoder {
if (parser.hasNext()) {
int value = parser.nextInt(16);
position.set(Position.KEY_BATTERY, value >> 8);
- position.set(Position.KEY_GSM, (value >> 4) & 0xf);
+ position.set(Position.KEY_RSSI, (value >> 4) & 0xf);
position.set(Position.KEY_SATELLITES, value & 0xf);
}
diff --git a/src/org/traccar/protocol/RaveonProtocolDecoder.java b/src/org/traccar/protocol/RaveonProtocolDecoder.java
index 19a9d6314..847bc4fb6 100644
--- a/src/org/traccar/protocol/RaveonProtocolDecoder.java
+++ b/src/org/traccar/protocol/RaveonProtocolDecoder.java
@@ -90,7 +90,7 @@ public class RaveonProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.PREFIX_TEMP + 1, parser.nextInt());
position.set(Position.KEY_POWER, parser.nextDouble());
position.set(Position.KEY_INPUT, parser.nextInt());
- position.set(Position.KEY_GSM, parser.nextInt());
+ position.set(Position.KEY_RSSI, parser.nextInt());
position.setSpeed(UnitsConverter.knotsFromKph(parser.nextInt()));
position.setCourse(parser.nextInt());
diff --git a/src/org/traccar/protocol/T800xProtocolDecoder.java b/src/org/traccar/protocol/T800xProtocolDecoder.java
index 52d711a8d..6430b1344 100644
--- a/src/org/traccar/protocol/T800xProtocolDecoder.java
+++ b/src/org/traccar/protocol/T800xProtocolDecoder.java
@@ -24,6 +24,8 @@ import org.traccar.helper.BcdUtil;
import org.traccar.helper.BitUtil;
import org.traccar.helper.DateBuilder;
import org.traccar.helper.UnitsConverter;
+import org.traccar.model.CellTower;
+import org.traccar.model.Network;
import org.traccar.model.Position;
import java.net.SocketAddress;
@@ -169,10 +171,9 @@ public class T800xProtocolDecoder extends BaseProtocolDecoder {
buf.readBytes(array);
ChannelBuffer swapped = ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, array);
- position.set(Position.KEY_MCC, swapped.readUnsignedShort());
- position.set(Position.KEY_MNC, swapped.readUnsignedShort());
- position.set(Position.KEY_LAC, swapped.readUnsignedShort());
- position.set(Position.KEY_CID, swapped.readUnsignedShort());
+ position.setNetwork(new Network(CellTower.from(
+ swapped.readUnsignedShort(), swapped.readUnsignedShort(),
+ swapped.readUnsignedShort(), swapped.readUnsignedShort())));
// two more cell towers
diff --git a/src/org/traccar/protocol/TeltonikaProtocolDecoder.java b/src/org/traccar/protocol/TeltonikaProtocolDecoder.java
index 474718ee8..074d89703 100644
--- a/src/org/traccar/protocol/TeltonikaProtocolDecoder.java
+++ b/src/org/traccar/protocol/TeltonikaProtocolDecoder.java
@@ -22,6 +22,8 @@ import org.traccar.BaseProtocolDecoder;
import org.traccar.DeviceSession;
import org.traccar.helper.BitUtil;
import org.traccar.helper.UnitsConverter;
+import org.traccar.model.CellTower;
+import org.traccar.model.Network;
import org.traccar.model.Position;
import java.net.SocketAddress;
@@ -133,12 +135,12 @@ public class TeltonikaProtocolDecoder extends BaseProtocolDecoder {
}
if (BitUtil.check(locationMask, 5)) {
- position.set(Position.KEY_LAC, buf.readUnsignedShort());
- position.set(Position.KEY_CID, buf.readUnsignedShort());
+ position.setNetwork(new Network(
+ CellTower.fromLacCid(buf.readUnsignedShort(), buf.readUnsignedShort())));
}
if (BitUtil.check(locationMask, 6)) {
- position.set(Position.KEY_GSM, buf.readUnsignedByte());
+ buf.readUnsignedByte(); // rssi
}
if (BitUtil.check(locationMask, 7)) {
diff --git a/src/org/traccar/protocol/ThinkRaceProtocolDecoder.java b/src/org/traccar/protocol/ThinkRaceProtocolDecoder.java
index f78f01329..4a97fa1a1 100644
--- a/src/org/traccar/protocol/ThinkRaceProtocolDecoder.java
+++ b/src/org/traccar/protocol/ThinkRaceProtocolDecoder.java
@@ -21,6 +21,8 @@ import org.jboss.netty.channel.Channel;
import org.traccar.BaseProtocolDecoder;
import org.traccar.DeviceSession;
import org.traccar.helper.BitUtil;
+import org.traccar.model.CellTower;
+import org.traccar.model.Network;
import org.traccar.model.Position;
import java.net.SocketAddress;
@@ -100,8 +102,8 @@ public class ThinkRaceProtocolDecoder extends BaseProtocolDecoder {
position.setSpeed(buf.readUnsignedByte());
position.setCourse(buf.readUnsignedByte());
- position.set(Position.KEY_LAC, buf.readUnsignedShort());
- position.set(Position.KEY_CID, buf.readUnsignedShort());
+ position.setNetwork(new Network(
+ CellTower.fromLacCid(buf.readUnsignedShort(), buf.readUnsignedShort())));
return position;
diff --git a/src/org/traccar/protocol/Tk103ProtocolDecoder.java b/src/org/traccar/protocol/Tk103ProtocolDecoder.java
index d3bc0efdc..9dc94678e 100644
--- a/src/org/traccar/protocol/Tk103ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Tk103ProtocolDecoder.java
@@ -24,6 +24,8 @@ import org.traccar.helper.DateBuilder;
import org.traccar.helper.Parser;
import org.traccar.helper.PatternBuilder;
import org.traccar.helper.UnitsConverter;
+import org.traccar.model.CellTower;
+import org.traccar.model.Network;
import org.traccar.model.Position;
import java.net.SocketAddress;
@@ -165,10 +167,8 @@ public class Tk103ProtocolDecoder extends BaseProtocolDecoder {
getLastLocation(position, null);
- position.set(Position.KEY_MCC, parser.nextInt());
- position.set(Position.KEY_MNC, parser.nextInt());
- position.set(Position.KEY_LAC, parser.nextInt(16));
- position.set(Position.KEY_CID, parser.nextInt(16));
+ position.setNetwork(new Network(CellTower.from(
+ parser.nextInt(), parser.nextInt(), parser.nextInt(16), parser.nextInt(16))));
return position;
}
diff --git a/src/org/traccar/protocol/TotemProtocolDecoder.java b/src/org/traccar/protocol/TotemProtocolDecoder.java
index 1fe91b942..7140190da 100644
--- a/src/org/traccar/protocol/TotemProtocolDecoder.java
+++ b/src/org/traccar/protocol/TotemProtocolDecoder.java
@@ -22,6 +22,8 @@ import org.traccar.helper.DateBuilder;
import org.traccar.helper.Parser;
import org.traccar.helper.PatternBuilder;
import org.traccar.helper.UnitsConverter;
+import org.traccar.model.CellTower;
+import org.traccar.model.Network;
import org.traccar.model.Position;
import java.net.SocketAddress;
@@ -249,8 +251,7 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder {
int lac = parser.nextInt(16);
int cid = parser.nextInt(16);
if (lac != 0 && cid != 0) {
- position.set(Position.KEY_LAC, lac);
- position.set(Position.KEY_CID, cid);
+ position.setNetwork(new Network(CellTower.fromLacCid(lac, cid)));
}
position.set(Position.PREFIX_TEMP + 1, parser.next());
@@ -272,8 +273,9 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.PREFIX_ADC + 2, parser.next());
position.set(Position.PREFIX_TEMP + 1, parser.next());
position.set(Position.PREFIX_TEMP + 2, parser.next());
- position.set(Position.KEY_LAC, parser.nextInt(16));
- position.set(Position.KEY_CID, parser.nextInt(16));
+
+ position.setNetwork(new Network(
+ CellTower.fromLacCid(parser.nextInt(16), parser.nextInt(16))));
position.setValid(parser.next().equals("A"));
position.set(Position.KEY_SATELLITES, parser.next());
@@ -307,10 +309,11 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.PREFIX_TEMP + 1, parser.next());
position.set(Position.PREFIX_TEMP + 2, parser.next());
- position.set(Position.KEY_LAC, parser.nextInt(16));
- position.set(Position.KEY_CID, parser.nextInt(16));
+ position.setNetwork(new Network(
+ CellTower.fromLacCid(parser.nextInt(16), parser.nextInt(16))));
+
position.set(Position.KEY_SATELLITES, parser.nextInt());
- position.set(Position.KEY_GSM, parser.nextInt());
+ position.set(Position.KEY_RSSI, parser.nextInt());
position.setCourse(parser.nextDouble());
position.setSpeed(UnitsConverter.knotsFromKph(parser.nextDouble()));
diff --git a/src/org/traccar/protocol/Tr900ProtocolDecoder.java b/src/org/traccar/protocol/Tr900ProtocolDecoder.java
index 32362acd2..1f867d5d1 100644
--- a/src/org/traccar/protocol/Tr900ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Tr900ProtocolDecoder.java
@@ -85,7 +85,7 @@ public class Tr900ProtocolDecoder extends BaseProtocolDecoder {
position.setSpeed(parser.nextDouble());
position.setCourse(parser.nextDouble());
- position.set(Position.KEY_GSM, parser.next());
+ position.set(Position.KEY_RSSI, parser.next());
position.set(Position.KEY_EVENT, parser.nextInt());
position.set(Position.PREFIX_ADC + 1, parser.nextInt());
position.set(Position.KEY_BATTERY, parser.nextInt());
diff --git a/src/org/traccar/protocol/TrvProtocolDecoder.java b/src/org/traccar/protocol/TrvProtocolDecoder.java
index 0afe065c2..3d8b6c66b 100644
--- a/src/org/traccar/protocol/TrvProtocolDecoder.java
+++ b/src/org/traccar/protocol/TrvProtocolDecoder.java
@@ -22,6 +22,8 @@ import org.traccar.helper.DateBuilder;
import org.traccar.helper.Parser;
import org.traccar.helper.PatternBuilder;
import org.traccar.helper.UnitsConverter;
+import org.traccar.model.CellTower;
+import org.traccar.model.Network;
import org.traccar.model.Position;
import java.net.SocketAddress;
@@ -104,7 +106,7 @@ public class TrvProtocolDecoder extends BaseProtocolDecoder {
getLastLocation(position, null);
- position.set(Position.KEY_GSM, parser.nextInt());
+ position.set(Position.KEY_RSSI, parser.nextInt());
position.set(Position.KEY_SATELLITES, parser.nextInt());
position.set(Position.KEY_BATTERY, parser.nextInt());
position.set(Position.KEY_IGNITION, parser.nextInt() != 0);
@@ -138,7 +140,7 @@ public class TrvProtocolDecoder extends BaseProtocolDecoder {
position.setCourse(parser.nextDouble());
- position.set(Position.KEY_GSM, parser.nextInt());
+ position.set(Position.KEY_RSSI, parser.nextInt());
position.set(Position.KEY_SATELLITES, parser.nextInt());
position.set(Position.KEY_BATTERY, parser.nextInt());
@@ -147,10 +149,8 @@ public class TrvProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_IGNITION, acc == 1);
}
- position.set(Position.KEY_MCC, parser.nextInt());
- position.set(Position.KEY_MNC, parser.nextInt());
- position.set(Position.KEY_LAC, parser.nextInt());
- position.set(Position.KEY_CID, parser.nextInt());
+ position.setNetwork(new Network(CellTower.from(
+ parser.nextInt(), parser.nextInt(), parser.nextInt(), parser.nextInt())));
return position;
}
diff --git a/src/org/traccar/protocol/Tt8850ProtocolDecoder.java b/src/org/traccar/protocol/Tt8850ProtocolDecoder.java
index b128068be..040783ba2 100644
--- a/src/org/traccar/protocol/Tt8850ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Tt8850ProtocolDecoder.java
@@ -22,6 +22,8 @@ import org.traccar.helper.DateBuilder;
import org.traccar.helper.Parser;
import org.traccar.helper.PatternBuilder;
import org.traccar.helper.UnitsConverter;
+import org.traccar.model.CellTower;
+import org.traccar.model.Network;
import org.traccar.model.Position;
import java.net.SocketAddress;
@@ -90,10 +92,8 @@ public class Tt8850ProtocolDecoder extends BaseProtocolDecoder {
position.setTime(dateBuilder.getDate());
if (parser.hasNext(4)) {
- position.set(Position.KEY_MCC, parser.nextInt());
- position.set(Position.KEY_MNC, parser.nextInt());
- position.set(Position.KEY_LAC, parser.nextInt(16));
- position.set(Position.KEY_CID, parser.nextInt(16));
+ position.setNetwork(new Network(
+ CellTower.from(parser.nextInt(), parser.nextInt(), parser.nextInt(16), parser.nextInt(16))));
}
return position;
diff --git a/src/org/traccar/protocol/TytanProtocolDecoder.java b/src/org/traccar/protocol/TytanProtocolDecoder.java
index b67902e56..429479de0 100644
--- a/src/org/traccar/protocol/TytanProtocolDecoder.java
+++ b/src/org/traccar/protocol/TytanProtocolDecoder.java
@@ -171,7 +171,7 @@ public class TytanProtocolDecoder extends BaseProtocolDecoder {
// Status
flags = buf.readUnsignedByte();
position.set(Position.KEY_IGNITION, BitUtil.check(flags, 0));
- position.set(Position.KEY_GSM, BitUtil.between(flags, 2, 5));
+ position.set(Position.KEY_RSSI, BitUtil.between(flags, 2, 5));
position.setCourse((BitUtil.from(flags, 5) * 45 + 180) % 360);
// Speed
diff --git a/src/org/traccar/protocol/TzoneProtocolDecoder.java b/src/org/traccar/protocol/TzoneProtocolDecoder.java
index 8fd695b80..a0ed41caf 100644
--- a/src/org/traccar/protocol/TzoneProtocolDecoder.java
+++ b/src/org/traccar/protocol/TzoneProtocolDecoder.java
@@ -22,6 +22,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;
@@ -118,10 +120,8 @@ public class TzoneProtocolDecoder extends BaseProtocolDecoder {
blockEnd = buf.readerIndex() + blockLength;
if (blockLength > 0) {
-
- position.set(Position.KEY_LAC, buf.readUnsignedShort());
- position.set(Position.KEY_CID, buf.readUnsignedShort());
-
+ position.setNetwork(new Network(
+ CellTower.fromLacCid(buf.readUnsignedShort(), buf.readUnsignedShort())));
}
buf.readerIndex(blockEnd);
@@ -136,7 +136,7 @@ public class TzoneProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_ALARM, decodeAlarm(buf.readUnsignedByte()));
buf.readUnsignedByte(); // terminal info
position.set(Position.PREFIX_IO + 1, buf.readUnsignedShort());
- position.set(Position.KEY_GSM, buf.readUnsignedByte());
+ position.set(Position.KEY_RSSI, buf.readUnsignedByte());
buf.readUnsignedByte(); // GSM status
position.set(Position.KEY_BATTERY, buf.readUnsignedShort());
position.set(Position.KEY_POWER, buf.readUnsignedShort());
diff --git a/src/org/traccar/protocol/UlbotechProtocolDecoder.java b/src/org/traccar/protocol/UlbotechProtocolDecoder.java
index d2a58f1b8..c4ddca219 100644
--- a/src/org/traccar/protocol/UlbotechProtocolDecoder.java
+++ b/src/org/traccar/protocol/UlbotechProtocolDecoder.java
@@ -24,6 +24,8 @@ import org.traccar.DeviceSession;
import org.traccar.helper.BitUtil;
import org.traccar.helper.ObdDecoder;
import org.traccar.helper.UnitsConverter;
+import org.traccar.model.CellTower;
+import org.traccar.model.Network;
import org.traccar.model.Position;
import java.net.SocketAddress;
@@ -182,15 +184,15 @@ public class UlbotechProtocolDecoder extends BaseProtocolDecoder {
break;
case DATA_LBS:
- position.set(Position.KEY_MCC, buf.readUnsignedShort());
- position.set(Position.KEY_MNC, buf.readUnsignedShort());
- position.set(Position.KEY_LAC, buf.readUnsignedShort());
if (length == 11) {
- position.set(Position.KEY_CID, buf.readUnsignedInt());
+ position.setNetwork(new Network(CellTower.from(
+ buf.readUnsignedShort(), buf.readUnsignedShort(),
+ buf.readUnsignedShort(), buf.readUnsignedInt(), -buf.readUnsignedByte())));
} else {
- position.set(Position.KEY_CID, buf.readUnsignedShort());
+ position.setNetwork(new Network(CellTower.from(
+ buf.readUnsignedShort(), buf.readUnsignedShort(),
+ buf.readUnsignedShort(), buf.readUnsignedShort(), -buf.readUnsignedByte())));
}
- position.set(Position.KEY_GSM, -buf.readUnsignedByte());
if (length > 9 && length != 11) {
buf.skipBytes(length - 9);
}
diff --git a/src/org/traccar/protocol/UproProtocolDecoder.java b/src/org/traccar/protocol/UproProtocolDecoder.java
index e47dd8595..37536d1dd 100644
--- a/src/org/traccar/protocol/UproProtocolDecoder.java
+++ b/src/org/traccar/protocol/UproProtocolDecoder.java
@@ -24,6 +24,8 @@ import org.traccar.helper.BitUtil;
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;
@@ -154,14 +156,11 @@ public class UproProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_ODOMETER, odometer * 2 * 1852 / 3600);
break;
case 'P':
- position.set(Position.KEY_MCC,
- Integer.parseInt(data.readBytes(4).toString(StandardCharsets.US_ASCII)));
- position.set(Position.KEY_MNC,
- Integer.parseInt(data.readBytes(4).toString(StandardCharsets.US_ASCII)));
- position.set(Position.KEY_LAC,
- Integer.parseInt(data.readBytes(4).toString(StandardCharsets.US_ASCII), 16));
- position.set(Position.KEY_CID,
- Integer.parseInt(data.readBytes(4).toString(StandardCharsets.US_ASCII), 16));
+ position.setNetwork(new Network(CellTower.from(
+ Integer.parseInt(data.readBytes(4).toString(StandardCharsets.US_ASCII)),
+ Integer.parseInt(data.readBytes(4).toString(StandardCharsets.US_ASCII)),
+ Integer.parseInt(data.readBytes(4).toString(StandardCharsets.US_ASCII), 16),
+ Integer.parseInt(data.readBytes(4).toString(StandardCharsets.US_ASCII), 16))));
break;
case 'Q':
position.set("obd-pid", ChannelBuffers.hexDump(data));
diff --git a/src/org/traccar/protocol/V680ProtocolDecoder.java b/src/org/traccar/protocol/V680ProtocolDecoder.java
index ca9c451c2..58ece0e75 100644
--- a/src/org/traccar/protocol/V680ProtocolDecoder.java
+++ b/src/org/traccar/protocol/V680ProtocolDecoder.java
@@ -89,7 +89,7 @@ public class V680ProtocolDecoder extends BaseProtocolDecoder {
position.set("password", parser.next());
position.set(Position.KEY_EVENT, parser.next());
position.set("packet", parser.next());
- position.set(Position.KEY_GSM, parser.next());
+ position.set(Position.KEY_RSSI, parser.next());
double lon = parser.nextDouble();
boolean west = parser.next().equals("W");
diff --git a/src/org/traccar/protocol/VisiontekProtocolDecoder.java b/src/org/traccar/protocol/VisiontekProtocolDecoder.java
index 5ce12bd19..0eac50817 100644
--- a/src/org/traccar/protocol/VisiontekProtocolDecoder.java
+++ b/src/org/traccar/protocol/VisiontekProtocolDecoder.java
@@ -119,7 +119,7 @@ public class VisiontekProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.PREFIX_IO + 2, parser.next());
position.set("immobilizer", parser.next());
position.set(Position.KEY_POWER, parser.next());
- position.set(Position.KEY_GSM, parser.next());
+ position.set(Position.KEY_RSSI, parser.next());
}
if (parser.hasNext(7)) {
diff --git a/src/org/traccar/protocol/WatchProtocolDecoder.java b/src/org/traccar/protocol/WatchProtocolDecoder.java
index 13eb73254..07df2de13 100644
--- a/src/org/traccar/protocol/WatchProtocolDecoder.java
+++ b/src/org/traccar/protocol/WatchProtocolDecoder.java
@@ -136,7 +136,7 @@ public class WatchProtocolDecoder extends BaseProtocolDecoder {
position.setAltitude(parser.nextDouble());
position.set(Position.KEY_SATELLITES, parser.nextInt());
- position.set(Position.KEY_GSM, parser.nextInt());
+ position.set(Position.KEY_RSSI, parser.nextInt());
position.set(Position.KEY_BATTERY, parser.nextInt());
position.set("steps", parser.nextInt());
diff --git a/src/org/traccar/protocol/XirgoProtocolDecoder.java b/src/org/traccar/protocol/XirgoProtocolDecoder.java
index f20f4ef35..633479350 100644
--- a/src/org/traccar/protocol/XirgoProtocolDecoder.java
+++ b/src/org/traccar/protocol/XirgoProtocolDecoder.java
@@ -140,7 +140,7 @@ public class XirgoProtocolDecoder extends BaseProtocolDecoder {
}
position.set(Position.KEY_BATTERY, parser.next());
- position.set(Position.KEY_GSM, parser.next());
+ position.set(Position.KEY_RSSI, parser.next());
if (!newFormat) {
position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1609.34);
diff --git a/src/org/traccar/protocol/Xt013ProtocolDecoder.java b/src/org/traccar/protocol/Xt013ProtocolDecoder.java
index 68497980b..40231a06d 100644
--- a/src/org/traccar/protocol/Xt013ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Xt013ProtocolDecoder.java
@@ -88,7 +88,7 @@ public class Xt013ProtocolDecoder extends BaseProtocolDecoder {
position.setValid(parser.next().equals("F"));
position.set(Position.KEY_GPS, parser.next());
- position.set(Position.KEY_GSM, parser.next());
+ position.set(Position.KEY_RSSI, parser.next());
position.set(Position.KEY_BATTERY, parser.next());
position.set(Position.KEY_CHARGE, parser.next());