aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-05-17 16:55:46 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-05-17 16:55:46 +1200
commit4b42dab928b652d95ffa65b251ded885f0904e52 (patch)
tree9037b10de0b587eac925f5bccfd3e5cb4739ce0d /src/org/traccar/protocol
parentc83ef50af070f44e3380e960e5fdd0604c9849d3 (diff)
downloadtrackermap-server-4b42dab928b652d95ffa65b251ded885f0904e52.tar.gz
trackermap-server-4b42dab928b652d95ffa65b251ded885f0904e52.tar.bz2
trackermap-server-4b42dab928b652d95ffa65b251ded885f0904e52.zip
Additional Aplicom F parameters
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r--src/org/traccar/protocol/AplicomProtocolDecoder.java56
-rw-r--r--src/org/traccar/protocol/Gl200TextProtocolDecoder.java4
-rw-r--r--src/org/traccar/protocol/MeiligaoProtocolDecoder.java2
3 files changed, 57 insertions, 5 deletions
diff --git a/src/org/traccar/protocol/AplicomProtocolDecoder.java b/src/org/traccar/protocol/AplicomProtocolDecoder.java
index 7ed187937..79dcac72a 100644
--- a/src/org/traccar/protocol/AplicomProtocolDecoder.java
+++ b/src/org/traccar/protocol/AplicomProtocolDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013 - 2017 Anton Tananaev (anton@traccar.org)
+ * Copyright 2013 - 2018 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -557,7 +557,7 @@ public class AplicomProtocolDecoder extends BaseProtocolDecoder {
}
if ((selector & 0x0040) != 0) {
- position.set("totalFuelUsed", buf.readUnsignedInt());
+ position.set(Position.KEY_FUEL_USED, buf.readUnsignedInt());
}
if ((selector & 0x0080) != 0) {
@@ -579,6 +579,58 @@ public class AplicomProtocolDecoder extends BaseProtocolDecoder {
position.set("overspeedCount", buf.readUnsignedByte());
}
+ if ((selector & 0x0800) != 0) {
+ position.set(Position.KEY_HOURS, buf.readUnsignedInt() * 0.05);
+ position.set(Position.KEY_RPM, buf.readUnsignedShort() * 0.125);
+ position.set(Position.KEY_OBD_SPEED, buf.readUnsignedShort() / 256.0);
+ position.set(Position.KEY_FUEL_USED, buf.readUnsignedInt() * 0.5);
+ position.set(Position.KEY_FUEL_LEVEL, buf.readUnsignedByte() * 0.4);
+ }
+
+ if ((selector & 0x1000) != 0) {
+ position.set("ambientTemperature", buf.readUnsignedShort() * 0.03125 - 273);
+ buf.readUnsignedShort(); // fuel rate
+ position.set("fuelEconomy", buf.readUnsignedShort() / 512.0);
+ position.set(Position.KEY_FUEL_CONSUMPTION, buf.readUnsignedInt() * 0.001);
+ buf.readUnsignedByte(); // pto drive engagement
+ }
+
+ if ((selector & 0x2000) != 0) {
+ buf.skipBytes(buf.readUnsignedByte()); // driver identification
+ }
+
+ if ((selector & 0x4000) != 0) {
+ position.set("torque", buf.readUnsignedByte());
+ position.set("brakePressure1", buf.readUnsignedByte() * 8);
+ position.set("brakePressure2", buf.readUnsignedByte() * 8);
+ position.set("grossWeight", buf.readUnsignedShort() * 10);
+ position.set("exhaustFluid", buf.readUnsignedByte() * 0.4);
+ buf.readUnsignedByte(); // retarder torque mode
+ position.set("retarderTorque", buf.readUnsignedByte());
+ position.set("retarderSelection", buf.readUnsignedByte() * 0.4);
+ buf.skipBytes(8); // tell tale status block 1
+ buf.skipBytes(8); // tell tale status block 2
+ buf.skipBytes(8); // tell tale status block 3
+ buf.skipBytes(8); // tell tale status block 4
+ }
+
+ if ((selector & 0x8000) != 0) {
+ position.set("parkingBrakeStatus", buf.readUnsignedByte());
+ position.set("doorStatus", buf.readUnsignedByte());
+ buf.skipBytes(8); // status per door
+ position.set("alternatorStatus", buf.readUnsignedByte());
+ position.set("selectedGear", buf.readUnsignedByte());
+ position.set("currentGear", buf.readUnsignedByte());
+ buf.skipBytes(4 * 2); // air suspension pressure
+ }
+
+ if ((selector & 0x0400) != 0) {
+ int count = buf.readUnsignedByte();
+ for (int i = 0; i < count; i++) {
+ position.set("axle" + i, buf.readUnsignedShort());
+ }
+ }
+
}
@Override
diff --git a/src/org/traccar/protocol/Gl200TextProtocolDecoder.java b/src/org/traccar/protocol/Gl200TextProtocolDecoder.java
index 598cee814..232f4cdfb 100644
--- a/src/org/traccar/protocol/Gl200TextProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gl200TextProtocolDecoder.java
@@ -557,10 +557,10 @@ public class Gl200TextProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_IGNITION, Integer.parseInt(values[index++]) > 0);
}
if (BitUtil.check(reportMask, 2)) {
- position.set("totalVehicleDistance", values[index++]);
+ position.set(Position.KEY_OBD_ODOMETER, values[index++]);
}
if (BitUtil.check(reportMask, 3)) {
- position.set("totalFuelConsumption", Double.parseDouble(values[index++]));
+ position.set(Position.KEY_FUEL_USED, Double.parseDouble(values[index++]));
}
if (BitUtil.check(reportMask, 5) && !values[index++].isEmpty()) {
position.set(Position.KEY_RPM, Integer.parseInt(values[index - 1]));
diff --git a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
index 7ae98b46d..d766e32c3 100644
--- a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
+++ b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java
@@ -319,7 +319,7 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder {
position.set("drivingRange", parser.nextDouble());
position.set(Position.KEY_ODOMETER, parser.nextDouble());
position.set("singleFuelConsumption", parser.nextDouble());
- position.set("totalFuelConsumption", parser.nextDouble());
+ position.set(Position.KEY_FUEL_USED, parser.nextDouble());
position.set(Position.KEY_DTCS, parser.nextInt());
position.set("hardAccelerationCount", parser.nextInt());
position.set("hardBrakingCount", parser.nextInt());