aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org
diff options
context:
space:
mode:
authorStefan Clark <stefanclark@gmail.com>2022-07-25 06:50:59 +0000
committerStefan Clark <stefanclark@gmail.com>2022-07-25 07:18:00 +0000
commit032d02b584553f4374c4bc6ae9f7c8e819595c42 (patch)
tree3481d2bf106fe29455687ee8a5f60c3e844703c3 /src/test/java/org
parent14dafcb4191ec25fa22494956cd509708a9e1b5c (diff)
downloadtrackermap-server-032d02b584553f4374c4bc6ae9f7c8e819595c42.tar.gz
trackermap-server-032d02b584553f4374c4bc6ae9f7c8e819595c42.tar.bz2
trackermap-server-032d02b584553f4374c4bc6ae9f7c8e819595c42.zip
Xexun2 Encoder - Initial Code
Diffstat (limited to 'src/test/java/org')
-rw-r--r--src/test/java/org/traccar/protocol/Xexun2ProtocolEncoderTest.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/test/java/org/traccar/protocol/Xexun2ProtocolEncoderTest.java b/src/test/java/org/traccar/protocol/Xexun2ProtocolEncoderTest.java
new file mode 100644
index 000000000..6d3b3e065
--- /dev/null
+++ b/src/test/java/org/traccar/protocol/Xexun2ProtocolEncoderTest.java
@@ -0,0 +1,29 @@
+package org.traccar.protocol;
+
+import org.junit.Test;
+import org.traccar.ProtocolTest;
+import org.traccar.model.Command;
+
+public class Xexun2ProtocolEncoderTest extends ProtocolTest {
+
+ @Test
+ public void testEncode() throws Exception {
+
+ var encoder = inject(new Xexun2ProtocolEncoder(null));
+
+ Command command;
+
+ command = new Command();
+ command.setDeviceId(604080829351806311L);
+ command.setType(Command.TYPE_POWER_OFF);
+ verifyCommand(encoder, command, binary("FAAF0007000186220505123456700004FEBC6F663D31FAAF"));
+
+ command = new Command();
+ command.setDeviceId(604080829351806311L);
+ command.setType(Command.TYPE_POSITION_PERIODIC);
+ command.set(Command.KEY_FREQUENCY, 150);
+ verifyCommand(encoder, command, binary("FAAF0007000186220505123456700015F90E747261636B696E675F73656E643D3135302C313530FAAF"));
+
+ }
+
+}