aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol
diff options
context:
space:
mode:
authorK-J-Dod24 <kieran.dodson@complexus.uk>2023-05-10 10:26:14 +0100
committerK-J-Dod24 <kieran.dodson@complexus.uk>2023-05-10 10:26:14 +0100
commitb81025ee361467848ec2a1771499a3b959fd7535 (patch)
tree2492d5aa2a37daf6414b9907dd2819919595f06b /src/main/java/org/traccar/protocol
parent445366d9a49fbee7a28a41e1f95423c07b54b725 (diff)
parentd797671b2ce6fb70ac868bb96f87be8b2a85e4f9 (diff)
downloadtrackermap-server-b81025ee361467848ec2a1771499a3b959fd7535.tar.gz
trackermap-server-b81025ee361467848ec2a1771499a3b959fd7535.tar.bz2
trackermap-server-b81025ee361467848ec2a1771499a3b959fd7535.zip
Merge branch 'Teltonika-io32-coolantTemp' of https://github.com/Complexus-Limited/traccar into Teltonika-io32-coolantTemp
Diffstat (limited to 'src/main/java/org/traccar/protocol')
-rw-r--r--src/main/java/org/traccar/protocol/FlespiProtocolDecoder.java3
-rw-r--r--src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java31
-rw-r--r--src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java1
3 files changed, 35 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/FlespiProtocolDecoder.java b/src/main/java/org/traccar/protocol/FlespiProtocolDecoder.java
index a7f6c284a..95d491af7 100644
--- a/src/main/java/org/traccar/protocol/FlespiProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/FlespiProtocolDecoder.java
@@ -130,6 +130,9 @@ public class FlespiProtocolDecoder extends BaseHttpProtocolDecoder {
case "dout":
position.set(Position.KEY_OUTPUT, ((JsonNumber) value).intValue());
return true;
+ case "report.reason":
+ position.set(Position.KEY_EVENT, ((JsonNumber) value).intValue());
+ return true;
case "gps.vehicle.mileage":
position.set(Position.KEY_ODOMETER, ((JsonNumber) value).doubleValue());
return true;
diff --git a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java
index 1aebba4e6..05e2fb8cc 100644
--- a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java
@@ -877,6 +877,22 @@ public class HuabaoProtocolDecoder extends BaseProtocolDecoder {
case 0x0539:
position.set(Position.KEY_FUEL_CONSUMPTION, buf.readUnsignedShort() * 0.01);
break;
+ case 0x052D:
+ position.set(Position.KEY_COOLANT_TEMP, buf.readUnsignedByte() - 40);
+ break;
+ case 0x0530:
+ position.set(Position.KEY_POWER, buf.readUnsignedShort() * 0.001);
+ break;
+ case 0x0535:
+ position.set(Position.KEY_OBD_SPEED, buf.readUnsignedShort() * 0.1);
+ break;
+ case 0x0536:
+ position.set(Position.KEY_RPM, buf.readUnsignedShort());
+ break;
+ case 0x0547:
+ case 0x0548:
+ position.set(Position.KEY_THROTTLE, buf.readUnsignedByte());
+ break;
default:
switch (length) {
case 1:
@@ -895,6 +911,20 @@ public class HuabaoProtocolDecoder extends BaseProtocolDecoder {
break;
}
}
+ getLastLocation(position, time);
+ decodeCoordinates(position, buf);
+ position.setTime(time);
+ break;
+ case 0x02:
+ count = buf.readUnsignedByte();
+ for (int i = 0; i < count; i++) {
+ buf.readUnsignedInt(); // system id
+ int codeCount = buf.readUnsignedShort();
+ for (int j = 0; j < codeCount; j++) {
+ buf.skipBytes(16); // code
+ }
+ }
+ getLastLocation(position, time);
decodeCoordinates(position, buf);
position.setTime(time);
break;
@@ -926,6 +956,7 @@ public class HuabaoProtocolDecoder extends BaseProtocolDecoder {
}
buf.skipBytes(length);
}
+ getLastLocation(position, time);
decodeCoordinates(position, buf);
position.setTime(time);
break;
diff --git a/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java b/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java
index 3cb89d6f7..d60107d7a 100644
--- a/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java
@@ -231,6 +231,7 @@ public class TeltonikaProtocolDecoder extends BaseProtocolDecoder {
register(26, null, (p, b) -> p.set("bleTemp2", b.readShort() * 0.01));
register(27, null, (p, b) -> p.set("bleTemp3", b.readShort() * 0.01));
register(28, null, (p, b) -> p.set("bleTemp4", b.readShort() * 0.01));
+ register(30, fmbXXX, (p, b) -> p.set("faultCount", b.readUnsignedByte()));
register(32, fmbXXX, (p, b) -> p.set(Position.KEY_COOLANT_TEMP, b.readByte()));
register(66, null, (p, b) -> p.set(Position.KEY_POWER, b.readUnsignedShort() * 0.001));
register(67, null, (p, b) -> p.set(Position.KEY_BATTERY, b.readUnsignedShort() * 0.001));