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/FifotrackProtocolDecoder.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/FifotrackProtocolDecoder.java')
-rw-r--r-- | src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java | 66 |
1 files changed, 22 insertions, 44 deletions
diff --git a/src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java b/src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java index 59019830f..0a0392acd 100644 --- a/src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/FifotrackProtocolDecoder.java @@ -157,50 +157,28 @@ public class FifotrackProtocolDecoder extends BaseProtocolDecoder { private String decodeAlarm(Integer alarm) { if (alarm != null) { - switch (alarm) { - case 2: - return Position.ALARM_SOS; - case 14: - return Position.ALARM_LOW_POWER; - case 15: - return Position.ALARM_POWER_CUT; - case 16: - return Position.ALARM_POWER_RESTORED; - case 17: - return Position.ALARM_LOW_BATTERY; - case 18: - return Position.ALARM_OVERSPEED; - case 20: - return Position.ALARM_GPS_ANTENNA_CUT; - case 21: - return Position.ALARM_VIBRATION; - case 23: - return Position.ALARM_ACCELERATION; - case 24: - return Position.ALARM_BRAKING; - case 27: - return Position.ALARM_FATIGUE_DRIVING; - case 30: - case 32: - return Position.ALARM_JAMMING; - case 31: - return Position.ALARM_FALL_DOWN; - case 33: - return Position.ALARM_GEOFENCE_EXIT; - case 34: - return Position.ALARM_GEOFENCE_ENTER; - case 35: - return Position.ALARM_IDLE; - case 40: - case 41: - return Position.ALARM_TEMPERATURE; - case 53: - return Position.ALARM_POWER_ON; - case 54: - return Position.ALARM_POWER_OFF; - default: - return null; - } + return switch (alarm) { + case 2 -> Position.ALARM_SOS; + case 14 -> Position.ALARM_LOW_POWER; + case 15 -> Position.ALARM_POWER_CUT; + case 16 -> Position.ALARM_POWER_RESTORED; + case 17 -> Position.ALARM_LOW_BATTERY; + case 18 -> Position.ALARM_OVERSPEED; + case 20 -> Position.ALARM_GPS_ANTENNA_CUT; + case 21 -> Position.ALARM_VIBRATION; + case 23 -> Position.ALARM_ACCELERATION; + case 24 -> Position.ALARM_BRAKING; + case 27 -> Position.ALARM_FATIGUE_DRIVING; + case 30, 32 -> Position.ALARM_JAMMING; + case 31 -> Position.ALARM_FALL_DOWN; + case 33 -> Position.ALARM_GEOFENCE_EXIT; + case 34 -> Position.ALARM_GEOFENCE_ENTER; + case 35 -> Position.ALARM_IDLE; + case 40, 41 -> Position.ALARM_TEMPERATURE; + case 53 -> Position.ALARM_POWER_ON; + case 54 -> Position.ALARM_POWER_OFF; + default -> null; + }; } return null; } |