use of org.traccar.model.Command in project traccar by tananaev.
the class Tk103ProtocolEncoderTest method testEncodePositionSingleAlternative.
@Test
public void testEncodePositionSingleAlternative() throws Exception {
Tk103ProtocolEncoder encoder = new Tk103ProtocolEncoder(true);
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_POSITION_SINGLE);
assertEquals("[begin]sms2,*getposl*,[end]", encoder.encodeCommand(command));
}
use of org.traccar.model.Command in project traccar by tananaev.
the class Tk103ProtocolEncoderTest method testEncodeSosOnAlternative.
@Test
public void testEncodeSosOnAlternative() 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, true);
assertEquals("[begin]sms2,*soson*,[end]", encoder.encodeCommand(command));
}
use of org.traccar.model.Command in project traccar by tananaev.
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 tananaev.
the class Tk103ProtocolEncoderTest method testEncodeSetOdometer.
@Test
public void testEncodeSetOdometer() throws Exception {
Tk103ProtocolEncoder encoder = new Tk103ProtocolEncoder();
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_SET_ODOMETER);
assertEquals("(123456789012345AX01)", encoder.encodeCommand(command));
}
use of org.traccar.model.Command in project traccar by tananaev.
the class Tk103ProtocolEncoderTest method testEncodePositionStop.
@Test
public void testEncodePositionStop() throws Exception {
Tk103ProtocolEncoder encoder = new Tk103ProtocolEncoder();
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_POSITION_STOP);
assertEquals("(123456789012345AR0000000000)", encoder.encodeCommand(command));
}
Aggregations