From d00eb7ebfdaf15bb9ec32011fc7953325f568e0a Mon Sep 17 00:00:00 2001 From: Matjaž Črnko Date: Tue, 4 Jan 2022 20:20:21 +0100 Subject: feat: Totem - basic support for SMS and GPRS commands --- .../org/traccar/protocol/TotemProtocolEncoderTest.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/test/java') diff --git a/src/test/java/org/traccar/protocol/TotemProtocolEncoderTest.java b/src/test/java/org/traccar/protocol/TotemProtocolEncoderTest.java index 51e5bac92..a4fca2d9e 100644 --- a/src/test/java/org/traccar/protocol/TotemProtocolEncoderTest.java +++ b/src/test/java/org/traccar/protocol/TotemProtocolEncoderTest.java @@ -15,10 +15,24 @@ public class TotemProtocolEncoderTest extends ProtocolTest { Command command = new Command(); command.setDeviceId(2); - command.setType(Command.TYPE_ENGINE_STOP); + command.setType(Command.TYPE_REBOOT_DEVICE); command.set(Command.KEY_DEVICE_PASSWORD, "000000"); - assertEquals("*000000,025,C,1#", encoder.encodeCommand(command)); + assertEquals("$$0020CF000000,0061D", encoder.encodeCommand(command)); + + } + + @Test + public void testSmsEncode() throws Exception { + + var encoder = new TotemProtocolSmsEncoder(null); + + Command command = new Command(); + command.setDeviceId(2); + command.setType(Command.TYPE_REBOOT_DEVICE); + command.set(Command.KEY_DEVICE_PASSWORD, "000000"); + + assertEquals("*000000,006#", encoder.encodeCommand(command)); } -- cgit v1.2.3