RUI3 API atMode

Hello,
I would like to implement my own AT command on a RAK5010.

void setup () {

api.system.atMode.add(“INFO”, “Geräte-Infos abfragen.”, “INFO”, info_handle, RAK_ATCMD_PERM_READ);

}

Simple info_handle(…) for the test:
int info_handle(SERIAL_PORT port, char *cmd, stParam *param) {
if (param->argc == 1 && !strcmp(param->argv[0], “?”)) {
Serial.printf("+INFO: “);
}
else if (param->argc == 1) {
Serial.printf(”+INFO: “);
}
else
Serial.printf(”+INFO: ");
return AT_OK;
}

Output:
AT+INFO?
AT_ERROR
AT+INFO: Command not found !!

What am I doing wrong?

Hello Dieter

Custom AT commands are starting with ATC, not with AT
So your calls should be ATC+INFO? and ATC+INFO=?

You can see it as well when you submit AT?. Custom AT commands are listed at the end.

image

Hello Bernd,

Thanks, work.
Where does the ATC stand? I didn’t read that in the API description.

It is nowhere written yet. The docs are not perfect yet.

If I hand over 2 arguments, they are always output together in param-> argv [0] == 12345,6789.

Shouldn’t the example ATC+TEST = 12345,6789\r

in the

int test_handle (serial_port port, char *cmd, stparam *param)

param-> argc == 2 and
param-> argv [0] == 12345 and
param-> argv [1] == 6789

be?

If you have more than one argument,they need to be separated by :, same as it is done by standard AT commands.

Example ATC+TEST=12345:6789