From 33f20c440ee2a132c222781c4197dff10ecc6b3c Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 13 Nov 2021 10:26:56 -0800 Subject: Add Topin protocol encoder --- .../traccar/protocol/TopinProtocolEncoderTest.java | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/test/java/org/traccar/protocol/TopinProtocolEncoderTest.java (limited to 'src/test/java') diff --git a/src/test/java/org/traccar/protocol/TopinProtocolEncoderTest.java b/src/test/java/org/traccar/protocol/TopinProtocolEncoderTest.java new file mode 100644 index 000000000..d3ff13941 --- /dev/null +++ b/src/test/java/org/traccar/protocol/TopinProtocolEncoderTest.java @@ -0,0 +1,24 @@ +package org.traccar.protocol; + +import org.junit.Test; +import org.traccar.ProtocolTest; +import org.traccar.model.Command; + +public class TopinProtocolEncoderTest extends ProtocolTest { + + @Test + public void testEncode() throws Exception { + + var encoder = new TopinProtocolEncoder(null); + + Command command = new Command(); + command.setDeviceId(1); + command.setType(Command.TYPE_SOS_NUMBER); + command.set(Command.KEY_INDEX, 1); + command.set(Command.KEY_PHONE, "13533333333"); + + verifyCommand(encoder, command, binary("78780C4131333533333333333333330D0A")); + + } + +} -- cgit v1.2.3