From ecbb40a86bb32005a734fd2da33890f4fd076901 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 8 May 2018 15:23:21 -0700 Subject: Support custom commands for TK103 (fix #3869) --- test/org/traccar/protocol/Tk103ProtocolEncoderTest.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/org/traccar/protocol') 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 @@ -220,6 +220,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 { -- cgit v1.2.3