From 398128c7c3f7de283e9d35e74d96e4990381ef1b Mon Sep 17 00:00:00 2001 From: Matjaž Črnko Date: Mon, 12 Jun 2023 17:10:01 +0200 Subject: Ruptela - motion, gps antenna alarm and inputs decoding improvements --- .../traccar/protocol/RuptelaProtocolDecoder.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java') diff --git a/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java b/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java index 85f0d407a..5fd7b755e 100644 --- a/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java @@ -97,8 +97,21 @@ public class RuptelaProtocolDecoder extends BaseProtocolDecoder { case 2: case 3: case 4: + case 5: position.set("di" + (id - 1), readValue(buf, length, false)); break; + case 20: + position.set("ai3", readValue(buf, length, false)); + break; + case 21: + position.set("ai4", readValue(buf, length, false)); + break; + case 22: + position.set("ai1", readValue(buf, length, false)); + break; + case 23: + position.set("ai2", readValue(buf, length, false)); + break; case 29: position.set(Position.KEY_POWER, readValue(buf, length, false)); break; @@ -135,6 +148,9 @@ public class RuptelaProtocolDecoder extends BaseProtocolDecoder { case 170: position.set(Position.KEY_CHARGE, readValue(buf, length, false) > 0); break; + case 173: + position.set(Position.KEY_MOTION, readValue(buf, length, false) == 1); + break; case 197: position.set(Position.KEY_RPM, readValue(buf, length, false) * 0.125); break; @@ -152,6 +168,11 @@ public class RuptelaProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_ALARM, Position.ALARM_ACCIDENT); } break; + case 415: + if (readValue(buf, length, false) != 1) { + position.set(Position.KEY_ALARM, Position.ALARM_GPS_ANTENNA_CUT); + } + break; case 645: position.set(Position.KEY_OBD_ODOMETER, readValue(buf, length, true) * 1000); break; -- cgit v1.2.3