aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol/CarcellProtocolEncoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/protocol/CarcellProtocolEncoder.java')
-rw-r--r--src/main/java/org/traccar/protocol/CarcellProtocolEncoder.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/main/java/org/traccar/protocol/CarcellProtocolEncoder.java b/src/main/java/org/traccar/protocol/CarcellProtocolEncoder.java
index 78dbe7e91..7a460b7c4 100644
--- a/src/main/java/org/traccar/protocol/CarcellProtocolEncoder.java
+++ b/src/main/java/org/traccar/protocol/CarcellProtocolEncoder.java
@@ -28,14 +28,11 @@ public class CarcellProtocolEncoder extends StringProtocolEncoder {
@Override
protected Object encodeCommand(Command command) {
- switch (command.getType()) {
- case Command.TYPE_ENGINE_STOP:
- return formatCommand(command, "$SRVCMD,%s,BA#\r\n", Command.KEY_UNIQUE_ID);
- case Command.TYPE_ENGINE_RESUME:
- return formatCommand(command, "$SRVCMD,%s,BD#\r\n", Command.KEY_UNIQUE_ID);
- default:
- return null;
- }
+ return switch (command.getType()) {
+ case Command.TYPE_ENGINE_STOP -> formatCommand(command, "$SRVCMD,%s,BA#\r\n", Command.KEY_UNIQUE_ID);
+ case Command.TYPE_ENGINE_RESUME -> formatCommand(command, "$SRVCMD,%s,BD#\r\n", Command.KEY_UNIQUE_ID);
+ default -> null;
+ };
}
}