Move UART command handlers into main/cmd/ for clearer layout.
Add cmd/ to CMake include paths and update documentation paths. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
#ifndef CMD_HANDLER_H
|
||||
#define CMD_HANDLER_H
|
||||
|
||||
#include "esp_err.h"
|
||||
#include "freertos/idf_additions.h"
|
||||
|
||||
typedef struct {
|
||||
uint16_t msg_id;
|
||||
uint8_t *payload;
|
||||
size_t len;
|
||||
} generic_msg_t;
|
||||
|
||||
typedef void (*msg_callback_t)(const uint8_t *data, size_t len);
|
||||
|
||||
typedef struct {
|
||||
uint16_t msg_id;
|
||||
msg_callback_t callback;
|
||||
} msg_binding_t;
|
||||
|
||||
void init_cmdHandler(QueueHandle_t queue);
|
||||
void vCmdDispatcherTask(void *param);
|
||||
|
||||
esp_err_t msg_register_handler(uint16_t id, msg_callback_t cb);
|
||||
esp_err_t msg_post(uint16_t id, const uint8_t *data, size_t len);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user