Looks like you have to send full message in HEX format.
but in the code shows like this.
private Object formatCommand(Command command, String content) {
String uniqueId = getUniqueId(command.getDeviceId());
int length = 1 + uniqueId.length() + 3 + content.length();
String result = String.format("##%02d,%s,1,%s*", length, uniqueId, content);
result += Checksum.sum(result) + "\r\n";
return result;
}
@Override
protected Object encodeCommand(Command command) {
switch (command.getType()) {
case Command.TYPE_CUSTOM:
return formatCommand(command, command.getString(Command.KEY_DATA));
case Command.TYPE_REQUEST_PHOTO:
return formatCommand(command, "D05,3");
default:
return null;
}
}
I don't see it. Can you please send a link to the file on GitHub.
Interesting. Yes, I think it should work. Is your device connected?
Yes, I checked again, it works.
Thanks for your time.
When we want to send a custom command to a device with parameters, we need to insert commas,
for example, fifotrack protocol, Output control command is B12,1,0,20