From 98de1d210d451e0ff8d2cbf5edeec9d5de1a0748 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 16 Dec 2017 17:18:03 +1300 Subject: Implement Xirgo XT-2160 output command --- .../traccar/protocol/XirgoProtocolEncoderTest.java | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 test/org/traccar/protocol/XirgoProtocolEncoderTest.java (limited to 'test/org/traccar') diff --git a/test/org/traccar/protocol/XirgoProtocolEncoderTest.java b/test/org/traccar/protocol/XirgoProtocolEncoderTest.java new file mode 100644 index 000000000..dd2e939c9 --- /dev/null +++ b/test/org/traccar/protocol/XirgoProtocolEncoderTest.java @@ -0,0 +1,26 @@ +package org.traccar.protocol; + +import org.junit.Test; +import org.traccar.ProtocolTest; +import org.traccar.model.Command; + +import static org.junit.Assert.assertEquals; + +public class XirgoProtocolEncoderTest extends ProtocolTest { + + @Test + public void testEncode() throws Exception { + + XirgoProtocolEncoder encoder = new XirgoProtocolEncoder(); + + Command command = new Command(); + command.setDeviceId(1); + command.setType(Command.TYPE_OUTPUT_CONTROL); + command.set(Command.KEY_INDEX, 0); + command.set(Command.KEY_DATA, 1); + + assertEquals("+XT:7005,2,1", encoder.encodeCommand(command)); + + } + +} -- cgit v1.2.3