dieter
(Dieter)
1
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?
beegee
(Bernd Giesecke)
2
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.
dieter
(Dieter)
3
Hello Bernd,
Thanks, work.
Where does the ATC stand? I didn’t read that in the API description.
beegee
(Bernd Giesecke)
4
It is nowhere written yet. The docs are not perfect yet.
dieter
(Dieter)
5
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?
beegee
(Bernd Giesecke)
6
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
system
(system)
Closed
7
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.