fix: add explicit route send failure results

This commit is contained in:
2026-04-23 18:06:02 +08:00
parent 22bc6a7fef
commit c1a0822227
2 changed files with 107 additions and 46 deletions
+22 -14
View File
@@ -29,6 +29,13 @@ typedef enum {
ROUTE_CONN_C2
} route_conn_type_t;
typedef enum {
ROUTE_SEND_OK = 0,
ROUTE_SEND_INVALID_INPUT,
ROUTE_SEND_POOL_EXHAUSTED,
ROUTE_SEND_QUEUE_FULL
} route_send_result_t;
typedef struct {
uint8_t src_id;
uint8_t dst_mask;
@@ -42,20 +49,21 @@ route_msg_t *route_msg_alloc(TickType_t wait_ticks);
route_msg_t *route_msg_alloc_from_isr(BaseType_t *xHigherPriorityTaskWoken);
void route_msg_free(route_msg_t *msg);
void route_msg_free_from_isr(route_msg_t *msg);
bool route_send(QueueHandle_t queue,
uint8_t src_id,
uint8_t dst_mask,
uint8_t conn_type,
const uint8_t *data,
uint16_t len,
TickType_t wait_ticks);
bool route_send_from_isr(QueueHandle_t queue,
uint8_t src_id,
uint8_t dst_mask,
uint8_t conn_type,
const uint8_t *data,
uint16_t len,
BaseType_t *xHigherPriorityTaskWoken);
const char *route_send_result_to_str(route_send_result_t result);
route_send_result_t route_send(QueueHandle_t queue,
uint8_t src_id,
uint8_t dst_mask,
uint8_t conn_type,
const uint8_t *data,
uint16_t len,
TickType_t wait_ticks);
route_send_result_t route_send_from_isr(QueueHandle_t queue,
uint8_t src_id,
uint8_t dst_mask,
uint8_t conn_type,
const uint8_t *data,
uint16_t len,
BaseType_t *xHigherPriorityTaskWoken);
#ifdef __cplusplus
}