use of org.traccar.model.Command in project traccar by tananaev.
the class T800xProtocolEncoderTest method testEncode.
@Test
public void testEncode() throws Exception {
T800xProtocolEncoder encoder = new T800xProtocolEncoder();
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_CUSTOM);
command.set(Command.KEY_DATA, "RELAY,0000,On#");
verifyCommand(encoder, command, binary("232381001e000101234567890123450152454c41592c303030302c4f6e23"));
}
use of org.traccar.model.Command in project traccar by tananaev.
the class TeltonikaProtocolEncoderTest method testEncode.
@Test
public void testEncode() throws Exception {
TeltonikaProtocolEncoder encoder = new TeltonikaProtocolEncoder();
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_CUSTOM);
command.set(Command.KEY_DATA, "setdigout 11");
verifyCommand(encoder, command, binary("00000000000000160C01050000000E7365746469676F75742031310D0A010000E258"));
}
use of org.traccar.model.Command in project traccar by tananaev.
the class Tk103ProtocolEncoderTest method testEncodePositionPeriodicAlternative.
@Test
public void testEncodePositionPeriodicAlternative() throws Exception {
Tk103ProtocolEncoder encoder = new Tk103ProtocolEncoder(true);
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_POSITION_PERIODIC);
assertEquals("[begin]sms2,*routetrack*99*,[end]", encoder.encodeCommand(command));
}
use of org.traccar.model.Command in project traccar by tananaev.
the class Tk103ProtocolEncoderTest method testEncodeEngineStop.
@Test
public void testEncodeEngineStop() throws Exception {
Tk103ProtocolEncoder encoder = new Tk103ProtocolEncoder();
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_ENGINE_STOP);
assertEquals("(123456789012345AV010)", encoder.encodeCommand(command));
}
use of org.traccar.model.Command in project traccar by tananaev.
the class Tk103ProtocolEncoderTest method testEncodeCustomAlternative.
@Test
public void testEncodeCustomAlternative() throws Exception {
Tk103ProtocolEncoder encoder = new Tk103ProtocolEncoder(true);
Command command = new Command();
command.setDeviceId(1);
command.setType(Command.TYPE_CUSTOM);
command.set(Command.KEY_DATA, "any text is ok");
assertEquals("[begin]sms2,any text is ok,[end]", encoder.encodeCommand(command));
}
Aggregations