diff options
Diffstat (limited to 'src/main/java/org/traccar/protocol/Tlt2hProtocolDecoder.java')
-rw-r--r-- | src/main/java/org/traccar/protocol/Tlt2hProtocolDecoder.java | 45 |
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); } } |