diff options
Diffstat (limited to 'src/main/java/org/traccar/protocol/WialonProtocolEncoder.java')
-rw-r--r-- | src/main/java/org/traccar/protocol/WialonProtocolEncoder.java | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/main/java/org/traccar/protocol/WialonProtocolEncoder.java b/src/main/java/org/traccar/protocol/WialonProtocolEncoder.java index 93086bf8a..7712f3cfc 100644 --- a/src/main/java/org/traccar/protocol/WialonProtocolEncoder.java +++ b/src/main/java/org/traccar/protocol/WialonProtocolEncoder.java @@ -28,18 +28,14 @@ public class WialonProtocolEncoder extends StringProtocolEncoder { @Override protected Object encodeCommand(Command command) { - switch (command.getType()) { - case Command.TYPE_REBOOT_DEVICE: - return formatCommand(command, "reboot\r\n"); - case Command.TYPE_SEND_USSD: - return formatCommand(command, "USSD:%s\r\n", Command.KEY_PHONE); - case Command.TYPE_IDENTIFICATION: - return formatCommand(command, "VER?\r\n"); - case Command.TYPE_OUTPUT_CONTROL: - return formatCommand(command, "L%s=%s\r\n", Command.KEY_INDEX, Command.KEY_DATA); - default: - return null; - } + return switch (command.getType()) { + case Command.TYPE_REBOOT_DEVICE -> formatCommand(command, "reboot\r\n"); + case Command.TYPE_SEND_USSD -> formatCommand(command, "USSD:%s\r\n", Command.KEY_PHONE); + case Command.TYPE_IDENTIFICATION -> formatCommand(command, "VER?\r\n"); + case Command.TYPE_OUTPUT_CONTROL -> + formatCommand(command, "L%s=%s\r\n", Command.KEY_INDEX, Command.KEY_DATA); + default -> null; + }; } } |