use of org.traccar.model.Command in project traccar by tananaev.
the class Gps103ProtocolEncoderTest method testEncodeCustom.
@Test
public void testEncodeCustom() throws Exception {
Gps103ProtocolEncoder encoder = new Gps103ProtocolEncoder();
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_CUSTOM);
command.set(Command.KEY_DATA, "H,080");
assertEquals("**,imei:123456789012345,H,080", encoder.encodeCommand(command));
}
use of org.traccar.model.Command in project traccar by tananaev.
the class H02ProtocolEncoderTest method testEngineStopEncode.
@Test
public void testEngineStopEncode() throws Exception {
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_ENGINE_STOP);
assertEquals("*HQ,123456789012345,S20,010203,1,3,10,3,5,5,3,5,3,5,3,5#", encoder.encodeCommand(command, time));
}
use of org.traccar.model.Command in project traccar by tananaev.
the class H02ProtocolEncoderTest method testAlarmArmEncode.
@Test
public void testAlarmArmEncode() throws Exception {
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_ALARM_ARM);
assertEquals("*HQ,123456789012345,SCF,010203,0,0#", encoder.encodeCommand(command, time));
}
use of org.traccar.model.Command in project traccar by tananaev.
the class H02ProtocolEncoderTest method testPositionPeriodicEncode.
@Test
public void testPositionPeriodicEncode() throws Exception {
Command command = new Command();
command.setDeviceId(1);
command.set(Command.KEY_FREQUENCY, 10);
command.setType(Command.TYPE_POSITION_PERIODIC);
assertEquals("*HQ,123456789012345,S71,010203,22,10#", encoder.encodeCommand(command, time));
}
use of org.traccar.model.Command in project traccar by tananaev.
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"));
}
Aggregations