nRF Connect SDK API 0.1.0
|
int at_parser_params_from_str | ( | const char * | at_params_str, |
char ** | next_param_str, | ||
struct at_param_list *const | list | ||
) |
#include <include/modem/at_cmd_parser.h>
Parse AT command or response parameters from a string.
This function parses the parameters from at_params_str
and saves them in list
.
list
must be initialized. It can be reused to parse multiple commands. When calling this function, the list is cleared. The maximum number of AT parameters that can be parsed and stored is limited by the size of list
.
If an error is returned by the parser, the content of list
should be ignored.
at_params_str | AT parameters as a null-terminated string. Can be numeric or string parameters. |
next_param_str | In the case a string contains multiple notifications, the parser will stop parsing when it is done parsing the first notification, and return the remainder of the string in this pointer. The return code will be EAGAIN. If multinotification is not used, this pointer can be set to NULL. |
list | Pointer to an initialized list where parameters are stored. Must not be NULL. |
0 | If the operation was successful. Otherwise, a (negative) error code is returned. |
-EAGAIN | New notification detected in string re-run the parser with the string pointed to by next_param_str . |
-E2BIG | The at_param_list supplied cannot hold all detected parameters in string. The list will contain the maximum number of parameters possible. |
-EINVAL | One or more of the supplied parameters are invalid. |