use of org.traccar.model.Command in project traccar by traccar.
the class Tk103ProtocolEncoderTest method testEncodeGetVersion.
@Test
public void testEncodeGetVersion() throws Exception {
Tk103ProtocolEncoder encoder = new Tk103ProtocolEncoder();
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_GET_VERSION);
assertEquals("(123456789012345AP07)", encoder.encodeCommand(command));
}
use of org.traccar.model.Command in project traccar by traccar.
the class Tk103ProtocolEncoderTest method testEncodePositionPeriodic.
@Test
public void testEncodePositionPeriodic() throws Exception {
Tk103ProtocolEncoder encoder = new Tk103ProtocolEncoder();
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_POSITION_PERIODIC);
command.set(Command.KEY_FREQUENCY, 60);
assertEquals("(123456789012345AR00003C0000)", encoder.encodeCommand(command));
}
use of org.traccar.model.Command in project traccar by traccar.
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 traccar.
the class Tk103ProtocolEncoderTest method testEncodeGetVersionAlternative.
@Test
public void testEncodeGetVersionAlternative() throws Exception {
Tk103ProtocolEncoder encoder = new Tk103ProtocolEncoder(true);
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_GET_VERSION);
assertEquals("[begin]sms2,*about*,[end]", encoder.encodeCommand(command));
}
use of org.traccar.model.Command in project traccar by traccar.
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"));
}
Aggregations