aboutsummaryrefslogtreecommitdiff
path: root/src/test/java
diff options
context:
space:
mode:
authorMatjaž Črnko <m.crnko@txt.si>2022-01-04 20:20:21 +0100
committerMatjaž Črnko <m.crnko@txt.si>2022-01-04 20:20:21 +0100
commitd00eb7ebfdaf15bb9ec32011fc7953325f568e0a (patch)
tree5450546ca9a8111ffde6b549b813aa507eec0986 /src/test/java
parent36202715301e365af212112d22059125adaea92a (diff)
downloadtrackermap-server-d00eb7ebfdaf15bb9ec32011fc7953325f568e0a.tar.gz
trackermap-server-d00eb7ebfdaf15bb9ec32011fc7953325f568e0a.tar.bz2
trackermap-server-d00eb7ebfdaf15bb9ec32011fc7953325f568e0a.zip
feat: Totem - basic support for SMS and GPRS commands
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/org/traccar/protocol/TotemProtocolEncoderTest.java18
1 files changed, 16 insertions, 2 deletions
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));
}