nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches

◆ at_parser_params_from_str()

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.

Parameters
at_params_strAT parameters as a null-terminated string. Can be numeric or string parameters.
next_param_strIn 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.
listPointer to an initialized list where parameters are stored. Must not be NULL.
Return values
0If the operation was successful. Otherwise, a (negative) error code is returned.
-EAGAINNew notification detected in string re-run the parser with the string pointed to by next_param_str.
-E2BIGThe at_param_list supplied cannot hold all detected parameters in string. The list will contain the maximum number of parameters possible.
-EINVALOne or more of the supplied parameters are invalid.