aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-05-08 15:23:21 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2018-05-08 15:23:21 -0700
commitecbb40a86bb32005a734fd2da33890f4fd076901 (patch)
tree3d736904975a8e5e1375894f0bec877ad1822ea4 /test/org/traccar
parente35ba89765eda5919870b3dfe43230974cf77a5e (diff)
downloadtrackermap-server-ecbb40a86bb32005a734fd2da33890f4fd076901.tar.gz
trackermap-server-ecbb40a86bb32005a734fd2da33890f4fd076901.tar.bz2
trackermap-server-ecbb40a86bb32005a734fd2da33890f4fd076901.zip
Support custom commands for TK103 (fix #3869)
Diffstat (limited to 'test/org/traccar')
-rw-r--r--test/org/traccar/protocol/Tk103ProtocolEncoderTest.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/Tk103ProtocolEncoderTest.java b/test/org/traccar/protocol/Tk103ProtocolEncoderTest.java
index 25968a0fe..34b2acf86 100644
--- a/test/org/traccar/protocol/Tk103ProtocolEncoderTest.java
+++ b/test/org/traccar/protocol/Tk103ProtocolEncoderTest.java
@@ -221,6 +221,20 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest {
}
@Test
+ public void testEncodeCustom() throws Exception {
+
+ Tk103ProtocolEncoder encoder = new Tk103ProtocolEncoder();
+
+ Command command = new Command();
+ command.setDeviceId(1);
+ command.setType(Command.TYPE_CUSTOM);
+ command.set(Command.KEY_DATA, "AA00");
+
+ assertEquals("(123456789012345AA00)", encoder.encodeCommand(command));
+
+ }
+
+ @Test
public void testEncodeCustomAlternative() throws Exception {
Tk103ProtocolEncoder encoder = new Tk103ProtocolEncoder(true);