|
SmartSnippets DA1459x SDK
|
Command Line Interface. More...
Files | |
| file | cli.h |
| Declarations for CLI service. | |
Data Structures | |
| struct | cli_command_t |
Macros | |
| #define | CLI_TASK_PRIORITY (OS_TASK_PRIORITY_NORMAL) |
| CLI task priority. | |
Typedefs | |
| typedef void * | cli_t |
| typedef void(* | cli_handler_t) (int argc, const char *argv[], void *user_data) |
Functions | |
| void | cli_init (void) |
| cli_t | cli_register (uint32_t notif_mask, const cli_command_t cmd_handler[], cli_handler_t def_handler) |
| void | cli_handle_notified (cli_t cli) |
Command Line Interface.
| typedef void(* cli_handler_t) (int argc, const char *argv[], void *user_data) |
Command handler
argv[0] is always a command name
| [in] | argc | number of arguments |
| [in] | argv | array of arguments |
| [in] | user_data | user data passed from command |
| typedef void* cli_t |
CLI instance
| void cli_handle_notified | ( | cli_t | cli | ) |
Handle notification from CLI
This function shall be called when application task is notified from CLI task to process pending entry.
Entry received from adapter will be split into tokens internally and matched against handlers provided on registration.
| [in] | cli | CLI instance |
| void cli_init | ( | void | ) |
Initialize CLI
This function initializes CLI internal structures and shall be called before CLI is used and after console_init().
| cli_t cli_register | ( | uint32_t | notif_mask, |
| const cli_command_t | cmd_handler[], | ||
| cli_handler_t | def_handler | ||
| ) |
Register command handlers for current task
This functions registers command handlers to be evaluated for matching CLI input.
Once full line of text is entered, CLI task notifies registered task using notif_mask and task shall then call cli_handle_notified() to process entry.
cmd_handler and application should guarantee that this pointer is valid for entire adapter lifetime.| [in] | notif_mask | bit mask for task notification |
| [in] | cmd_handler | predefined commands handlers |
| [in] | def_handler | default command handler |
1.8.16