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/OwnTracksProtocolDecoder.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/OwnTracksProtocolDecoder.java')
-rw-r--r-- | src/main/java/org/traccar/protocol/OwnTracksProtocolDecoder.java | 38 |
1 files changed, 10 insertions, 28 deletions
diff --git a/src/main/java/org/traccar/protocol/OwnTracksProtocolDecoder.java b/src/main/java/org/traccar/protocol/OwnTracksProtocolDecoder.java index e54d07fa7..f04c4a295 100644 --- a/src/main/java/org/traccar/protocol/OwnTracksProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/OwnTracksProtocolDecoder.java @@ -167,31 +167,15 @@ public class OwnTracksProtocolDecoder extends BaseHttpProtocolDecoder { private void setEventOrAlarm(Position position, String trigger, Integer reportType) { switch (trigger) { - case "9": - position.set(Position.KEY_ALARM, Position.ALARM_LOW_BATTERY); - break; - case "1": - position.set(Position.KEY_ALARM, Position.ALARM_POWER_ON); - break; - case "i": - position.set(Position.KEY_IGNITION, true); - break; - case "I": - position.set(Position.KEY_IGNITION, false); - break; - case "E": - position.set(Position.KEY_ALARM, Position.ALARM_POWER_RESTORED); - break; - case "e": - position.set(Position.KEY_ALARM, Position.ALARM_POWER_CUT); - break; - case "!": - position.set(Position.KEY_ALARM, Position.ALARM_TOW); - break; - case "s": - position.set(Position.KEY_ALARM, Position.ALARM_OVERSPEED); - break; - case "h": + case "9" -> position.set(Position.KEY_ALARM, Position.ALARM_LOW_BATTERY); + case "1" -> position.set(Position.KEY_ALARM, Position.ALARM_POWER_ON); + case "i" -> position.set(Position.KEY_IGNITION, true); + case "I" -> position.set(Position.KEY_IGNITION, false); + case "E" -> position.set(Position.KEY_ALARM, Position.ALARM_POWER_RESTORED); + case "e" -> position.set(Position.KEY_ALARM, Position.ALARM_POWER_CUT); + case "!" -> position.set(Position.KEY_ALARM, Position.ALARM_TOW); + case "s" -> position.set(Position.KEY_ALARM, Position.ALARM_OVERSPEED); + case "h" -> { switch (reportType) { case 0: case 3: @@ -207,9 +191,7 @@ public class OwnTracksProtocolDecoder extends BaseHttpProtocolDecoder { position.set(Position.KEY_ALARM, Position.ALARM_CORNERING); break; } - break; - default: - break; + } } } } |