From 823878d4f797cf2fb8e2c6e3b466b3316613d886 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 9 Mar 2024 14:27:13 -0800 Subject: Expand GV355CEU CAN support --- .../traccar/protocol/Gl200TextProtocolDecoder.java | 38 +++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'src/main') diff --git a/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java index 2e5ffa8d6..7a8d67cf9 100644 --- a/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java @@ -468,7 +468,6 @@ public class Gl200TextProtocolDecoder extends BaseProtocolDecoder { index += 1; // report type index += 1; // can bus state long reportMask = Long.parseLong(v[index++], 16); - long reportMaskExt = 0; if (BitUtil.check(reportMask, 0)) { position.set(Position.KEY_VIN, v[index++]); @@ -572,6 +571,8 @@ public class Gl200TextProtocolDecoder extends BaseProtocolDecoder { index += 1; // electric report mask } } + + long reportMaskExt = 0; if (BitUtil.check(reportMask, 29) && !v[index++].isEmpty()) { reportMaskExt = Long.parseLong(v[index - 1], 16); } @@ -647,6 +648,41 @@ public class Gl200TextProtocolDecoder extends BaseProtocolDecoder { if (BitUtil.check(reportMaskExt, 23)) { index += 1; // engine torque } + if (BitUtil.check(reportMaskExt, 24)) { + index += 1; // service distance + } + if (BitUtil.check(reportMaskExt, 25)) { + index += 1; // ambient temperature + } + if (BitUtil.check(reportMaskExt, 26)) { + index += 1; // tachograph driver1 working time mask + } + if (BitUtil.check(reportMaskExt, 27)) { + index += 1; // tachograph driver2 working time mask + } + if (BitUtil.check(reportMaskExt, 28)) { + index += 1; // dtc codes + } + if (BitUtil.check(reportMaskExt, 29)) { + index += 1; // gaseous fuel level + } + if (BitUtil.check(reportMaskExt, 30)) { + index += 1; // tachograph information expand + } + + long reportMaskCan = 0; + if (BitUtil.check(reportMaskExt, 31) && !v[index++].isEmpty()) { + reportMaskCan = Long.parseLong(v[index - 1], 16); + } + if (BitUtil.check(reportMaskCan, 0)) { + index += 1; // retarder usage + } + if (BitUtil.check(reportMaskCan, 1)) { + index += 1; // power mode + } + if (BitUtil.check(reportMaskCan, 2)) { + index += 1; // tachograph timestamp + } DateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); -- cgit v1.2.3