diff options
author | Anton Tananaev <anton@traccar.org> | 2024-01-19 07:57:49 -0800 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2024-01-19 07:57:49 -0800 |
commit | 77a2b4f5e587f648502f3a72e525b7c960e58c80 (patch) | |
tree | 4c6b5fe39086b13ccde8c4b6538ce6b9f1f1afd2 | |
parent | bb8ff944398cd79f2d576f25758ea9dd6c35d384 (diff) | |
download | trackermap-server-77a2b4f5e587f648502f3a72e525b7c960e58c80.tar.gz trackermap-server-77a2b4f5e587f648502f3a72e525b7c960e58c80.tar.bz2 trackermap-server-77a2b4f5e587f648502f3a72e525b7c960e58c80.zip |
Support NatureLink parameters
-rw-r--r-- | src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java index a102e9e44..2243bd982 100644 --- a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java @@ -471,8 +471,12 @@ public class HuabaoProtocolDecoder extends BaseProtocolDecoder { case 0x02: position.set(Position.KEY_FUEL_LEVEL, buf.readUnsignedShort() * 0.1); break; + case 0x25: + position.set(Position.KEY_INPUT, buf.readUnsignedInt()); + break; case 0x2b: - position.set(Position.KEY_FUEL_CONSUMPTION, buf.readUnsignedInt()); + position.set(Position.PREFIX_ADC + 1, buf.readUnsignedShort()); + position.set(Position.PREFIX_ADC + 2, buf.readUnsignedShort()); break; case 0x30: position.set(Position.KEY_RSSI, buf.readUnsignedByte()); @@ -517,6 +521,36 @@ public class HuabaoProtocolDecoder extends BaseProtocolDecoder { buf.readUnsignedByte(); // rssi } break; + case 0x64: + buf.readUnsignedInt(); // alarm serial number + buf.readUnsignedByte(); // alarm status + position.set("adasAlarm", buf.readUnsignedByte()); + break; + case 0x65: + buf.readUnsignedInt(); // alarm serial number + buf.readUnsignedByte(); // alarm status + position.set("dmsAlarm", buf.readUnsignedByte()); + break; + case 0x70: + buf.readUnsignedInt(); // alarm serial number + buf.readUnsignedByte(); // alarm status + switch (buf.readUnsignedByte()) { + case 0x01: + position.set(Position.KEY_ALARM, Position.ALARM_ACCELERATION); + break; + case 0x02: + position.set(Position.KEY_ALARM, Position.ALARM_BRAKING); + break; + case 0x03: + position.set(Position.KEY_ALARM, Position.ALARM_CORNERING); + break; + case 0x16: + position.set(Position.KEY_ALARM, Position.ALARM_ACCIDENT); + break; + default: + break; + } + break; case 0x69: position.set(Position.KEY_BATTERY, buf.readUnsignedShort() * 0.01); break; @@ -571,7 +605,11 @@ public class HuabaoProtocolDecoder extends BaseProtocolDecoder { break; case 0xD4: case 0xE1: - position.set(Position.KEY_BATTERY_LEVEL, buf.readUnsignedByte()); + if (length == 1) { + position.set(Position.KEY_BATTERY_LEVEL, buf.readUnsignedByte()); + } else { + position.set(Position.KEY_DRIVER_UNIQUE_ID, String.valueOf(buf.readUnsignedInt())); + } break; case 0xD5: if (length == 2) { @@ -594,6 +632,9 @@ public class HuabaoProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_MOTION, BitUtil.check(deviceStatus, 2)); position.set("cover", BitUtil.check(deviceStatus, 3)); break; + case 0xE2: + position.set(Position.KEY_FUEL_LEVEL, buf.readUnsignedInt() * 0.1); + break; case 0xE6: while (buf.readerIndex() < endIndex) { int sensorIndex = buf.readUnsignedByte(); |