feat(console): Added runtime component registration support in console_simple_init

This commit is contained in:
Abhik Roy
2023-10-24 16:37:31 +02:00
parent 2e6732882d
commit 057873c1b5
7 changed files with 98 additions and 16 deletions

View File

@ -13,28 +13,46 @@
extern "C" {
#endif
/* This stucture describes the plugin to the rest of the application */
typedef struct {
/* A pointer to the name of the command */
const char *name;
/* A function which performs auto-registration of console commands */
esp_err_t (*plugin_regd_fn)(void);
} console_cmd_plugin_desc_t;
/**
* @brief Initializes the esp console
* @return
* - esp_err_t
* @return ESP_OK on success
*/
esp_err_t console_cmd_init(void);
/**
* @brief Initialize Ethernet driver based on Espressif IoT Development Framework Configuration
* @brief Register a user supplied command
*
* @param[in] cmd string that is the user defined command
* @param[in] do_user_cmd Function pointer for a user-defined command callback function
*
* @return
* - esp_err_t
* @return ESP_OK on success
*/
esp_err_t console_cmd_user_register(char *user_cmd, esp_console_cmd_func_t do_user_cmd);
/**
* @brief Register all the console commands in .console_cmd_desc section
*
* @return ESP_OK on success
*/
esp_err_t console_cmd_all_register(void);
/**
* @brief Starts the esp console
* @return
* - esp_err_t
* @return ESP_OK on success
*/
esp_err_t console_cmd_start(void);