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/Gps103ProtocolDecoder.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/Gps103ProtocolDecoder.java')
-rw-r--r-- | src/main/java/org/traccar/protocol/Gps103ProtocolDecoder.java | 44 |
1 files changed, 15 insertions, 29 deletions
diff --git a/src/main/java/org/traccar/protocol/Gps103ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gps103ProtocolDecoder.java index d1c35b478..554a23915 100644 --- a/src/main/java/org/traccar/protocol/Gps103ProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/Gps103ProtocolDecoder.java @@ -141,35 +141,21 @@ public class Gps103ProtocolDecoder extends BaseProtocolDecoder { } else if (value.startsWith("oil")) { return Position.ALARM_FUEL_LEAK; } - switch (value) { - case "help me": - return Position.ALARM_SOS; - case "low battery": - return Position.ALARM_LOW_BATTERY; - case "stockade": - return Position.ALARM_GEOFENCE; - case "move": - return Position.ALARM_MOVEMENT; - case "speed": - return Position.ALARM_OVERSPEED; - case "door alarm": - return Position.ALARM_DOOR; - case "ac alarm": - return Position.ALARM_POWER_CUT; - case "accident alarm": - return Position.ALARM_ACCIDENT; - case "sensor alarm": - return Position.ALARM_VIBRATION; - case "bonnet alarm": - return Position.ALARM_BONNET; - case "footbrake alarm": - return Position.ALARM_FOOT_BRAKE; - case "DTC": - return Position.ALARM_FAULT; - case "tracker": - default: - return null; - } + return switch (value) { + case "help me" -> Position.ALARM_SOS; + case "low battery" -> Position.ALARM_LOW_BATTERY; + case "stockade" -> Position.ALARM_GEOFENCE; + case "move" -> Position.ALARM_MOVEMENT; + case "speed" -> Position.ALARM_OVERSPEED; + case "door alarm" -> Position.ALARM_DOOR; + case "ac alarm" -> Position.ALARM_POWER_CUT; + case "accident alarm" -> Position.ALARM_ACCIDENT; + case "sensor alarm" -> Position.ALARM_VIBRATION; + case "bonnet alarm" -> Position.ALARM_BONNET; + case "footbrake alarm" -> Position.ALARM_FOOT_BRAKE; + case "DTC" -> Position.ALARM_FAULT; + default -> null; + }; } private Position decodeRegular(Channel channel, SocketAddress remoteAddress, String sentence) { |