From 46f09ad36017e9ac160cf029551dc2586f21504f Mon Sep 17 00:00:00 2001 From: Zeus The Developer <75146431+zeustd@users.noreply.github.com> Date: Wed, 10 May 2023 20:24:42 +0530 Subject: Add VL502 Alarms Added support for VL502 additional alarms, Protocol document Page 44, 0x03 --- .../java/org/traccar/protocol/HuabaoProtocolDecoder.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src') diff --git a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java index ed71861a5..2c6f9af96 100644 --- a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java @@ -951,6 +951,21 @@ public class HuabaoProtocolDecoder extends BaseProtocolDecoder { case 0x23: position.set(Position.KEY_ALARM, Position.ALARM_FATIGUE_DRIVING); break; + case 0x26: + case 0x27: + case 0x28: + position.set(Position.KEY_ALARM, Position.ALARM_ACCIDENT); + break; + case 0x31: + case 0x32: + position.set(Position.KEY_ALARM, Position.ALARM_DOOR); + break; + case 0x01: + position.set(Position.KEY_ALARM, Position.ALARM_POWER_RESTORED); + break; + case 0x02: + position.set(Position.KEY_ALARM, Position.ALARM_POWER_CUT); + break; default: break; } -- cgit v1.2.3 From c3fe534d28c35d252ca97d99ae1b4d1fbe87d2f0 Mon Sep 17 00:00:00 2001 From: Zeus The Developer <75146431+zeustd@users.noreply.github.com> Date: Wed, 10 May 2023 20:34:54 +0530 Subject: Update case by order id Sort cases by order id --- .../java/org/traccar/protocol/HuabaoProtocolDecoder.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java index 2c6f9af96..e6980dc28 100644 --- a/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/HuabaoProtocolDecoder.java @@ -934,6 +934,12 @@ public class HuabaoProtocolDecoder extends BaseProtocolDecoder { int id = buf.readUnsignedByte(); int length = buf.readUnsignedByte(); switch (id) { + case 0x01: + position.set(Position.KEY_ALARM, Position.ALARM_POWER_RESTORED); + break; + case 0x02: + position.set(Position.KEY_ALARM, Position.ALARM_POWER_CUT); + break; case 0x1A: position.set(Position.KEY_ALARM, Position.ALARM_ACCELERATION); break; @@ -960,12 +966,6 @@ public class HuabaoProtocolDecoder extends BaseProtocolDecoder { case 0x32: position.set(Position.KEY_ALARM, Position.ALARM_DOOR); break; - case 0x01: - position.set(Position.KEY_ALARM, Position.ALARM_POWER_RESTORED); - break; - case 0x02: - position.set(Position.KEY_ALARM, Position.ALARM_POWER_CUT); - break; default: break; } -- cgit v1.2.3