aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/Gps103ProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/protocol/Gps103ProtocolDecoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/Gps103ProtocolDecoder.java44
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) {