aboutsummaryrefslogtreecommitdiff
path: root/src/test/java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2022-02-04 11:56:58 -0800
committerGitHub <noreply@github.com>2022-02-04 11:56:58 -0800
commit5878ea602d087da291687a0120b5a3f31f7ee861 (patch)
tree851c6e2b388b97f3cdaa7a539e713a6e0d5d2c05 /src/test/java
parent135b98315ff4a34025b21221862236936e745823 (diff)
parentc21626223cd0c480725d8057a2cd4bf2b9d7e0b3 (diff)
downloadtrackermap-server-5878ea602d087da291687a0120b5a3f31f7ee861.tar.gz
trackermap-server-5878ea602d087da291687a0120b5a3f31f7ee861.tar.bz2
trackermap-server-5878ea602d087da291687a0120b5a3f31f7ee861.zip
Merge pull request #4790 from jinzo/totem-advanced-commands
Totem 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));
}