use of org.traccar.model.Command in project traccar by traccar.
the class RuptelaProtocolEncoderTest method testEncode.
@Test
public void testEncode() throws Exception {
RuptelaProtocolEncoder encoder = new RuptelaProtocolEncoder();
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_CUSTOM);
command.set(Command.KEY_DATA, " Setio 2,1");
verifyCommand(encoder, command, binary("000b6c20536574696F20322C31eb3e"));
}
use of org.traccar.model.Command in project traccar by traccar.
the class HuabaoProtocolEncoderTest method testEncode.
@Ignore
@Test
public void testEncode() throws Exception {
HuabaoProtocolEncoder encoder = new HuabaoProtocolEncoder();
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_ENGINE_STOP);
verifyCommand(encoder, command, binary("7EA0060007001403305278017701150424154610AD7E"));
}
use of org.traccar.model.Command in project traccar by traccar.
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 PortmanProtocolEncoderTest method testEncodeEngineResume.
@Test
public void testEncodeEngineResume() {
var encoder = new PortmanProtocolEncoder(null);
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_ENGINE_RESUME);
assertEquals("&&123456789012345,XA6\r\n", encoder.encodeCommand(command));
}
use of org.traccar.model.Command in project traccar by tananaev.
the class PretraceProtocolEncoderTest method testEncodePositionPeriodic.
@Test
public void testEncodePositionPeriodic() throws Exception {
var encoder = new PretraceProtocolEncoder(null);
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_POSITION_PERIODIC);
command.set(Command.KEY_FREQUENCY, 300);
assertEquals("(123456789012345D221300,300,,^69)", encoder.encodeCommand(command));
}
Aggregations