use of org.traccar.model.Command in project traccar by tananaev.
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 tananaev.
the class Tk103ProtocolEncoderTest method testEncodeSosNumberAlternative.
@Test
public void testEncodeSosNumberAlternative() throws Exception {
Tk103ProtocolEncoder encoder = new Tk103ProtocolEncoder(true);
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_SOS_NUMBER);
command.set(Command.KEY_INDEX, "0");
command.set(Command.KEY_PHONE, "+55555555555");
command.set(Command.KEY_DEVICE_PASSWORD, "232323");
assertEquals("[begin]sms2,*master*232323*+55555555555*,[end]", encoder.encodeCommand(command));
}
use of org.traccar.model.Command in project traccar by tananaev.
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 tananaev.
the class Tk103ProtocolEncoderTest method testEncodePositionStopAlternative.
@Test
public void testEncodePositionStopAlternative() throws Exception {
Tk103ProtocolEncoder encoder = new Tk103ProtocolEncoder(true);
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_POSITION_STOP);
assertEquals("[begin]sms2,*routetrackoff*,[end]", encoder.encodeCommand(command));
}
use of org.traccar.model.Command in project traccar by tananaev.
the class Tk103ProtocolEncoderTest method testEncodeIdentificationAlternative.
@Test
public void testEncodeIdentificationAlternative() throws Exception {
Tk103ProtocolEncoder encoder = new Tk103ProtocolEncoder(true);
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_IDENTIFICATION);
assertEquals("[begin]sms2,999999,[end]", encoder.encodeCommand(command));
}
Aggregations