diff options
author | Iván Ávalos <avalos@disroot.org> | 2024-08-03 20:52:00 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2024-08-03 20:52:00 -0600 |
commit | 55f6d92c09a5b1d8566b53633d07be3d31010d3b (patch) | |
tree | b86bed801b0bbadb72c7e839296dae1d28b12bbb /src/main/java/org/traccar/protocol/MegastekProtocolDecoder.java | |
parent | c04ad7d48331253c095fc123ded1b00f6ff871d3 (diff) | |
parent | 2788174193def918a3a1a5be3bbed24c9613323f (diff) | |
download | trackermap-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/MegastekProtocolDecoder.java')
-rw-r--r-- | src/main/java/org/traccar/protocol/MegastekProtocolDecoder.java | 70 |
1 files changed, 22 insertions, 48 deletions
diff --git a/src/main/java/org/traccar/protocol/MegastekProtocolDecoder.java b/src/main/java/org/traccar/protocol/MegastekProtocolDecoder.java index 06b6f0e76..c16a0752d 100644 --- a/src/main/java/org/traccar/protocol/MegastekProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/MegastekProtocolDecoder.java @@ -387,54 +387,28 @@ public class MegastekProtocolDecoder extends BaseProtocolDecoder { return Position.ALARM_GEOFENCE_EXIT; } } - switch (value) { - case "pw on": - case "poweron": - return Position.ALARM_POWER_ON; - case "poweroff": - return Position.ALARM_POWER_OFF; - case "sos": - case "help": - return Position.ALARM_SOS; - case "over speed": - case "overspeed": - return Position.ALARM_OVERSPEED; - case "lowspeed": - return Position.ALARM_LOW_SPEED; - case "low battery": - case "lowbattery": - return Position.ALARM_LOW_BATTERY; - case "low extern voltage": - return Position.ALARM_LOW_POWER; - case "gps cut": - return Position.ALARM_GPS_ANTENNA_CUT; - case "vib": - return Position.ALARM_VIBRATION; - case "move in": - return Position.ALARM_GEOFENCE_ENTER; - case "move out": - return Position.ALARM_GEOFENCE_EXIT; - case "corner": - return Position.ALARM_CORNERING; - case "fatigue": - return Position.ALARM_FATIGUE_DRIVING; - case "psd": - return Position.ALARM_POWER_CUT; - case "psr": - return Position.ALARM_POWER_RESTORED; - case "hit": - return Position.ALARM_VIBRATION; - case "belt on": - case "belton": - return Position.ALARM_LOCK; - case "belt off": - case "beltoff": - return Position.ALARM_UNLOCK; - case "error": - return Position.ALARM_FAULT; - default: - return null; - } + return switch (value) { + case "pw on", "poweron" -> Position.ALARM_POWER_ON; + case "poweroff" -> Position.ALARM_POWER_OFF; + case "sos", "help" -> Position.ALARM_SOS; + case "over speed", "overspeed" -> Position.ALARM_OVERSPEED; + case "lowspeed" -> Position.ALARM_LOW_SPEED; + case "low battery", "lowbattery" -> Position.ALARM_LOW_BATTERY; + case "low extern voltage" -> Position.ALARM_LOW_POWER; + case "gps cut" -> Position.ALARM_GPS_ANTENNA_CUT; + case "vib" -> Position.ALARM_VIBRATION; + case "move in" -> Position.ALARM_GEOFENCE_ENTER; + case "move out" -> Position.ALARM_GEOFENCE_EXIT; + case "corner" -> Position.ALARM_CORNERING; + case "fatigue" -> Position.ALARM_FATIGUE_DRIVING; + case "psd" -> Position.ALARM_POWER_CUT; + case "psr" -> Position.ALARM_POWER_RESTORED; + case "hit" -> Position.ALARM_VIBRATION; + case "belt on", "belton" -> Position.ALARM_LOCK; + case "belt off", "beltoff" -> Position.ALARM_UNLOCK; + case "error" -> Position.ALARM_FAULT; + default -> null; + }; } @Override |