use of org.traccar.model.Command in project traccar by tananaev.
the class EelinkProtocolEncoderTest method testEncode.
@Test
public void testEncode() throws Exception {
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_ENGINE_STOP);
verifyCommand(new EelinkProtocolEncoder(false), command, binary("676780000f0000010000000052454c41592c3123"));
verifyCommand(new EelinkProtocolEncoder(true), command, binary("454c001eb41a0123456789012345676780000f0000010000000052454c41592c3123"));
}
use of org.traccar.model.Command in project traccar by tananaev.
the class Gt06ProtocolEncoderTest method testEncode.
@Test
public void testEncode() throws Exception {
Gt06ProtocolEncoder encoder = new Gt06ProtocolEncoder();
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_ENGINE_STOP);
verifyCommand(encoder, command, binary("787812800c0000000052656c61792c312300009dee0d0a"));
}
use of org.traccar.model.Command in project traccar by tananaev.
the class H02ProtocolEncoderTest method testEngineResumeEncode.
@Test
public void testEngineResumeEncode() throws Exception {
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_ENGINE_RESUME);
assertEquals("*HQ,123456789012345,S20,010203,0,0#", encoder.encodeCommand(command, time));
}
use of org.traccar.model.Command in project traccar by tananaev.
the class H02ProtocolEncoderTest method testAlarmDisarmEncode.
@Test
public void testAlarmDisarmEncode() throws Exception {
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_ALARM_DISARM);
assertEquals("*HQ,123456789012345,SCF,010203,1,1#", encoder.encodeCommand(command, time));
}
use of org.traccar.model.Command in project traccar by tananaev.
the class MeitrackProtocolEncoderTest method testEncode.
@Test
public void testEncode() throws Exception {
MeitrackProtocolEncoder encoder = new MeitrackProtocolEncoder();
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_POSITION_SINGLE);
assertEquals("@@Q25,123456789012345,A10*68\r\n", encoder.encodeCommand(command));
command.setDeviceId(1);
command.setType(Command.TYPE_REQUEST_PHOTO);
assertEquals("@@D46,123456789012345,D03,1,camera_picture.jpg*1F\r\n", encoder.encodeCommand(command));
command.setDeviceId(1);
command.setType(Command.TYPE_SEND_SMS);
command.set(Command.KEY_PHONE, "15360853789");
command.set(Command.KEY_MESSAGE, "Meitrack");
assertEquals("@@f48,123456789012345,C02,0,15360853789,Meitrack*B0\r\n", encoder.encodeCommand(command));
}
Aggregations