use of org.traccar.model.Command in project traccar by tananaev.
the class Tk103ProtocolEncoderTest method testEncodePositionSingleAlternative.
@Test
public void testEncodePositionSingleAlternative() {
var encoder = new Tk103ProtocolEncoder(null, 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 testEncodeGetVersion.
@Test
public void testEncodeGetVersion() {
var encoder = new Tk103ProtocolEncoder(null);
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 testEncodeIdentificationAlternative.
@Test
public void testEncodeIdentificationAlternative() {
var encoder = new Tk103ProtocolEncoder(null, true);
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_IDENTIFICATION);
assertEquals("[begin]sms2,999999,[end]", encoder.encodeCommand(command));
}
use of org.traccar.model.Command in project traccar by tananaev.
the class Tk103ProtocolEncoderTest method testEncodePositionPeriodic.
@Test
public void testEncodePositionPeriodic() {
var encoder = new Tk103ProtocolEncoder(null);
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 testEncodeSetOdometer.
@Test
public void testEncodeSetOdometer() {
var encoder = new Tk103ProtocolEncoder(null);
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_SET_ODOMETER);
assertEquals("(123456789012345AX01)", encoder.encodeCommand(command));
}
Aggregations