aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/Tlt2hProtocolDecoder.java
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2024-08-03 20:52:00 -0600
committerIván Ávalos <avalos@disroot.org>2024-08-03 20:52:00 -0600
commit55f6d92c09a5b1d8566b53633d07be3d31010d3b (patch)
treeb86bed801b0bbadb72c7e839296dae1d28b12bbb /src/main/java/org/traccar/protocol/Tlt2hProtocolDecoder.java
parentc04ad7d48331253c095fc123ded1b00f6ff871d3 (diff)
parent2788174193def918a3a1a5be3bbed24c9613323f (diff)
downloadtrackermap-server-55f6d92c09a5b1d8566b53633d07be3d31010d3b.tar.gz
trackermap-server-55f6d92c09a5b1d8566b53633d07be3d31010d3b.tar.bz2
trackermap-server-55f6d92c09a5b1d8566b53633d07be3d31010d3b.zip
Merge tag 'tags/v6.3'
Diffstat (limited to 'src/main/java/org/traccar/protocol/Tlt2hProtocolDecoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/Tlt2hProtocolDecoder.java45
1 files changed, 11 insertions, 34 deletions
diff --git a/src/main/java/org/traccar/protocol/Tlt2hProtocolDecoder.java b/src/main/java/org/traccar/protocol/Tlt2hProtocolDecoder.java
index 6be3d2dc3..2d59ffda8 100644
--- a/src/main/java/org/traccar/protocol/Tlt2hProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Tlt2hProtocolDecoder.java
@@ -101,40 +101,17 @@ public class Tlt2hProtocolDecoder extends BaseProtocolDecoder {
private void decodeStatus(Position position, String status) {
switch (status) {
- case "AUTOSTART":
- case "AUTO":
- position.set(Position.KEY_IGNITION, true);
- break;
- case "AUTOSTOP":
- case "AUTOLOW":
- position.set(Position.KEY_IGNITION, false);
- break;
- case "TOWED":
- position.set(Position.KEY_ALARM, Position.ALARM_TOW);
- break;
- case "SOS":
- position.set(Position.KEY_ALARM, Position.ALARM_SOS);
- break;
- case "DEF":
- position.set(Position.KEY_ALARM, Position.ALARM_POWER_CUT);
- break;
- case "BLP":
- position.set(Position.KEY_ALARM, Position.ALARM_LOW_BATTERY);
- break;
- case "CLP":
- position.set(Position.KEY_ALARM, Position.ALARM_LOW_POWER);
- break;
- case "OS":
- position.set(Position.KEY_ALARM, Position.ALARM_GEOFENCE_EXIT);
- break;
- case "RS":
- position.set(Position.KEY_ALARM, Position.ALARM_GEOFENCE_ENTER);
- break;
- case "OVERSPEED":
- position.set(Position.KEY_ALARM, Position.ALARM_OVERSPEED);
- break;
- default:
- break;
+ case "AUTOSTART", "AUTO" -> position.set(Position.KEY_IGNITION, true);
+ case "AUTOSTOP", "AUTOLOW" -> position.set(Position.KEY_IGNITION, false);
+ case "TOWED" -> position.set(Position.KEY_ALARM, Position.ALARM_TOW);
+ case "SHAKE" -> position.set(Position.KEY_ALARM, Position.ALARM_VIBRATION);
+ case "SOS" -> position.set(Position.KEY_ALARM, Position.ALARM_SOS);
+ case "DEF" -> position.set(Position.KEY_ALARM, Position.ALARM_POWER_CUT);
+ case "BLP" -> position.set(Position.KEY_ALARM, Position.ALARM_LOW_BATTERY);
+ case "CLP" -> position.set(Position.KEY_ALARM, Position.ALARM_LOW_POWER);
+ case "OS" -> position.set(Position.KEY_ALARM, Position.ALARM_GEOFENCE_EXIT);
+ case "RS" -> position.set(Position.KEY_ALARM, Position.ALARM_GEOFENCE_ENTER);
+ case "OVERSPEED" -> position.set(Position.KEY_ALARM, Position.ALARM_OVERSPEED);
}
}