aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol
diff options
context:
space:
mode:
authorNikolay Vlahovski <nvlahovski@gmail.com>2023-05-18 09:35:27 +0300
committerGitHub <noreply@github.com>2023-05-18 09:35:27 +0300
commitadbe25e9daa125e989c853068bc600c61234c342 (patch)
treebcba9f4c91ed6dbb5dc29a275fe24c063c1c145b /src/main/java/org/traccar/protocol
parent074dc016d21f9848140d125c2812d8abf25e8d53 (diff)
parentfbd3ee0d77673d94766a87aa67c05885e44aa7e5 (diff)
downloadtrackermap-server-adbe25e9daa125e989c853068bc600c61234c342.tar.gz
trackermap-server-adbe25e9daa125e989c853068bc600c61234c342.tar.bz2
trackermap-server-adbe25e9daa125e989c853068bc600c61234c342.zip
Merge branch 'traccar:master' into master
Diffstat (limited to 'src/main/java/org/traccar/protocol')
-rw-r--r--src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java9
-rw-r--r--src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java2
2 files changed, 8 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java
index 4beee7696..ee5ab19d6 100644
--- a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java
@@ -919,14 +919,19 @@ public class HuabaoProtocolDecoder extends BaseProtocolDecoder {
position.setTime(time);
break;
case 0x02:
- count = buf.readUnsignedByte();
+ List<String> codes = new LinkedList<>();
+ count = buf.readUnsignedShort();
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
+ buf.readUnsignedInt(); // dtc
+ buf.readUnsignedInt(); // status
+ codes.add(buf.readCharSequence(
+ buf.readUnsignedShort(), StandardCharsets.US_ASCII).toString().trim());
}
}
+ position.set(Position.KEY_DTCS, String.join(" ", codes));
getLastLocation(position, time);
decodeCoordinates(position, buf);
position.setTime(time);
diff --git a/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java b/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java
index fc18424df..2f378f30a 100644
--- a/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java
@@ -232,6 +232,7 @@ public class TeltonikaProtocolDecoder extends BaseProtocolDecoder {
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));
register(68, fmbXXX, (p, b) -> p.set("batteryCurrent", b.readUnsignedShort() * 0.001));
@@ -247,7 +248,6 @@ public class TeltonikaProtocolDecoder extends BaseProtocolDecoder {
});
register(80, fmbXXX, (p, b) -> p.set("dataMode", b.readUnsignedByte()));
register(90, null, (p, b) -> p.set(Position.KEY_DOOR, b.readUnsignedShort()));
- register(115, fmbXXX, (p, b) -> p.set(Position.KEY_COOLANT_TEMP, b.readShort() * 0.1));
register(179, null, (p, b) -> p.set(Position.PREFIX_OUT + 1, b.readUnsignedByte() > 0));
register(180, null, (p, b) -> p.set(Position.PREFIX_OUT + 2, b.readUnsignedByte() > 0));
register(181, null, (p, b) -> p.set(Position.KEY_PDOP, b.readUnsignedShort() * 0.1));