use of org.traccar.model.Command in project traccar by tananaev.
the class Tk103ProtocolEncoderTest method testEncodePositionSingle.
@Test
public void testEncodePositionSingle() throws Exception {
Tk103ProtocolEncoder encoder = new Tk103ProtocolEncoder();
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_POSITION_SINGLE);
assertEquals("(123456789012345AP00)", encoder.encodeCommand(command));
}
use of org.traccar.model.Command in project traccar by tananaev.
the class Tk103ProtocolEncoderTest method testEncodeSosOffAlternative.
@Test
public void testEncodeSosOffAlternative() throws Exception {
Tk103ProtocolEncoder encoder = new Tk103ProtocolEncoder(true);
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_ALARM_SOS);
command.set(Command.KEY_ENABLE, false);
assertEquals("[begin]sms2,*sosoff*,[end]", encoder.encodeCommand(command));
}
use of org.traccar.model.Command in project traccar by tananaev.
the class TotemProtocolEncoderTest method testEncode.
@Test
public void testEncode() throws Exception {
TotemProtocolEncoder encoder = new TotemProtocolEncoder();
Command command = new Command();
command.setDeviceId(2);
command.setType(Command.TYPE_ENGINE_STOP);
command.set(Command.KEY_DEVICE_PASSWORD, "000000");
assertEquals("*000000,025,C,1#", encoder.encodeCommand(command));
}
use of org.traccar.model.Command in project traccar by tananaev.
the class CellocatorProtocolEncoderTest method testEncode.
@Ignore
@Test
public void testEncode() throws Exception {
CellocatorProtocolEncoder encoder = new CellocatorProtocolEncoder();
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");
verifyCommand(encoder, command, binary("4D434750000000000000000000000303101000000000000026"));
}
use of org.traccar.model.Command in project traccar by tananaev.
the class CityeasyProtocolEncoderTest method testEncode.
@Test
public void testEncode() throws Exception {
CityeasyProtocolEncoder encoder = new CityeasyProtocolEncoder();
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_SET_TIMEZONE);
command.set(Command.KEY_TIMEZONE, "GMT+6");
verifyCommand(encoder, command, binary("5353001100080001680000000B60820D0A"));
}
Aggregations