调整格式,添加注释和说明

This commit is contained in:
2025-12-30 15:39:29 +08:00
parent 79a5899717
commit 83b013c678
3 changed files with 127 additions and 26 deletions

View File

@@ -20,19 +20,34 @@ typedef enum {
{ \
{GUI, 4, {ACM, SENSOR, WIFI, VOICE}}, \
{SENSOR, 1, {GUI}}, \
{ACM, 1, {WIFI}}, \
{WIFI, 0}, \
{VOICE, 3, {ACM, VOICE, GUI}}, \
}
/* 消息处理回调 */
// #define SUBSCIBE_INFO \
// { \
// {GUI, 4, {ACM, WIFI, VOICE, SENSOR}}, \
// {SENSOR, 5, {ACM, GUI, WIFI, VOICE, SENSOR}}, \
// {ACM, 4, {GUI, WIFI, VOICE, SENSOR}}, \
// {WIFI, 4, {ACM, GUI, VOICE, SENSOR}}, \
// {VOICE, 4, {ACM, WIFI, GUI, SENSOR}}, \
// }
/**
* @brief 消息处理回调类型
* @param module_id:发布者的id号
* @param buf:消息数据指针
* @param len:消息数据长度
* @return 0:成功 -1失败
*/
typedef int (*has_msg_handle_cb)(unsigned char module_id, const unsigned char *buf, unsigned int len);
/* 基础功能 */
int has_msg_init(void);
int has_msg_init_module(has_module_ID_e module_id); // HAS OS调用
int has_msg_publish(has_module_ID_e module_id, void *buffer, unsigned int length);
int has_msg_handle(has_module_ID_e module_id, has_msg_handle_cb cb);
int has_msg_os_init(void);
unsigned int has_msg_is_message_empty(has_module_ID_e module_id);
unsigned int has_msg_get_message_number(has_module_ID_e module_id);
int has_msg_delete_all_message(has_module_ID_e module_id);