diff options
Diffstat (limited to 'src/main/java/org/traccar/protocol/Tlt2hProtocolDecoder.java')
-rw-r--r-- | src/main/java/org/traccar/protocol/Tlt2hProtocolDecoder.java | 48 |
1 files changed, 11 insertions, 37 deletions
diff --git a/src/main/java/org/traccar/protocol/Tlt2hProtocolDecoder.java b/src/main/java/org/traccar/protocol/Tlt2hProtocolDecoder.java index c8ea66b6c..2d59ffda8 100644 --- a/src/main/java/org/traccar/protocol/Tlt2hProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/Tlt2hProtocolDecoder.java @@ -101,43 +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 "SHAKE": - position.set(Position.KEY_ALARM, Position.ALARM_VIBRATION); - 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); } } |