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/Pt502ProtocolDecoder.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/Pt502ProtocolDecoder.java')
-rw-r--r-- | src/main/java/org/traccar/protocol/Pt502ProtocolDecoder.java | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/src/main/java/org/traccar/protocol/Pt502ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Pt502ProtocolDecoder.java index 2a6a81a65..2e88186b8 100644 --- a/src/main/java/org/traccar/protocol/Pt502ProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/Pt502ProtocolDecoder.java @@ -66,28 +66,18 @@ public class Pt502ProtocolDecoder extends BaseProtocolDecoder { .compile(); private String decodeAlarm(String value) { - switch (value) { - case "IN1": - return Position.ALARM_SOS; - case "GOF": - return Position.ALARM_GEOFENCE; - case "TOW": - return Position.ALARM_TOW; - case "HDA": - return Position.ALARM_ACCELERATION; - case "HDB": - return Position.ALARM_BRAKING; - case "FDA": - return Position.ALARM_FATIGUE_DRIVING; - case "SKA": - return Position.ALARM_VIBRATION; - case "PMA": - return Position.ALARM_MOVEMENT; - case "CPA": - return Position.ALARM_POWER_CUT; - default: - return null; - } + return switch (value) { + case "IN1" -> Position.ALARM_SOS; + case "GOF" -> Position.ALARM_GEOFENCE; + case "TOW" -> Position.ALARM_TOW; + case "HDA" -> Position.ALARM_ACCELERATION; + case "HDB" -> Position.ALARM_BRAKING; + case "FDA" -> Position.ALARM_FATIGUE_DRIVING; + case "SKA" -> Position.ALARM_VIBRATION; + case "PMA" -> Position.ALARM_MOVEMENT; + case "CPA" -> Position.ALARM_POWER_CUT; + default -> null; + }; } private Position decodePosition(Channel channel, SocketAddress remoteAddress, String sentence) { |