use of org.traccar.model.Command in project traccar by tananaev.
the class MeiligaoProtocolEncoderTest method testEncode.
@Test
public void testEncode() throws Exception {
var encoder = new MeiligaoProtocolEncoder(null);
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_POSITION_SINGLE);
verifyCommand(encoder, command, binary("404000111234567890123441016cf70d0a"));
command.setType(Command.TYPE_POSITION_PERIODIC);
command.set(Command.KEY_FREQUENCY, 100);
verifyCommand(encoder, command, binary("40400013123456789012344102000a2f4f0d0a"));
command.setType(Command.TYPE_SET_TIMEZONE);
command.set(Command.KEY_TIMEZONE, "GMT+8");
verifyCommand(encoder, command, binary("4040001412345678901234413234383030ad0d0a"));
command.setType(Command.TYPE_REBOOT_DEVICE);
verifyCommand(encoder, command, binary("40400011123456789012344902d53d0d0a"));
command.setType(Command.TYPE_ALARM_GEOFENCE);
command.set(Command.KEY_RADIUS, 1000);
verifyCommand(encoder, command, binary("4040001312345678901234410603e87bb00d0a"));
}
use of org.traccar.model.Command in project traccar by tananaev.
the class RuptelaProtocolEncoderTest method testEncode.
@Test
public void testEncode() throws Exception {
var encoder = new RuptelaProtocolEncoder(null);
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"));
command.set(Command.KEY_DATA, "000b890100000000007fffffff89f0");
verifyCommand(encoder, command, binary("000b890100000000007fffffff89f0"));
}
use of org.traccar.model.Command in project traccar by tananaev.
the class NoranProtocolEncoderTest method testEncode.
@Test
public void testEncode() throws Exception {
var encoder = new NoranProtocolEncoder(null);
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_ENGINE_STOP);
verifyCommand(encoder, command, binary("0d0a2a4b5700440002000000000000002a4b572c3030302c3030372c3030303030302c302300000000000000000000000000000000000000000000000000000000000d0a"));
}
use of org.traccar.model.Command in project traccar by tananaev.
the class PortmanProtocolEncoderTest method testEncodeEngineStop.
@Test
public void testEncodeEngineStop() {
var encoder = new PortmanProtocolEncoder(null);
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_ENGINE_STOP);
assertEquals("&&123456789012345,XA5\r\n", encoder.encodeCommand(command));
}
use of org.traccar.model.Command in project traccar by tananaev.
the class PstProtocolEncoderTest method testEncodeEngineStop.
@Test
public void testEncodeEngineStop() {
var encoder = new PstProtocolEncoder(null);
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_ENGINE_STOP);
verifyCommand(encoder, command, binary("860ddf790600000001060002ffffffffe42b"));
}
Aggregations