aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-08-19 13:16:30 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-08-19 13:16:30 +1200
commit854ad6ce2c39695ed2cdf5f584be10be53ed6c33 (patch)
tree97011f4786599d9a0437fa71c0902e18d9836f10 /src/org/traccar
parentd63222309ed80155033d6458a163acd76f46f9a6 (diff)
downloadtrackermap-server-854ad6ce2c39695ed2cdf5f584be10be53ed6c33.tar.gz
trackermap-server-854ad6ce2c39695ed2cdf5f584be10be53ed6c33.tar.bz2
trackermap-server-854ad6ce2c39695ed2cdf5f584be10be53ed6c33.zip
Fix Atrack binary message decoding
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/protocol/AtrackProtocolDecoder.java28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/AtrackProtocolDecoder.java b/src/org/traccar/protocol/AtrackProtocolDecoder.java
index ff4e0efeb..17b0466b1 100644
--- a/src/org/traccar/protocol/AtrackProtocolDecoder.java
+++ b/src/org/traccar/protocol/AtrackProtocolDecoder.java
@@ -267,6 +267,30 @@ public class AtrackProtocolDecoder extends BaseProtocolDecoder {
case "MA":
readString(buf); // mac address
break;
+ case "PD":
+ buf.readUnsignedByte(); // pending code status
+ break;
+ case "CD":
+ readString(buf); // sim cid
+ break;
+ case "CM":
+ buf.readLong(); // imsi
+ break;
+ case "GN":
+ buf.skipBytes(60); // g sensor data
+ break;
+ case "GV":
+ buf.skipBytes(6); // maximum g force
+ break;
+ case "ME":
+ readString(buf); // imei
+ break;
+ case "IA":
+ buf.readUnsignedByte(); // intake air temperature
+ break;
+ case "MP":
+ buf.readUnsignedByte(); // manifold absolute pressure
+ break;
default:
break;
}
@@ -274,7 +298,7 @@ public class AtrackProtocolDecoder extends BaseProtocolDecoder {
if (cellTower.getMobileCountryCode() != null
&& cellTower.getMobileNetworkCode() != null
- && cellTower.getCellId() != null
+ && cellTower.getCellId() != null && cellTower.getCellId() != 0
&& cellTower.getLocationAreaCode() != null) {
position.setNetwork(new Network(cellTower));
} else if (cellTower.getSignalStrength() != null) {
@@ -519,7 +543,7 @@ public class AtrackProtocolDecoder extends BaseProtocolDecoder {
if (custom) {
String form = this.form;
if (form == null) {
- form = readString(buf).substring("%CI".length());
+ form = readString(buf).trim().substring("%CI".length());
}
readBinaryCustomData(position, buf, form);
}