TuyaOS
uni_msg_queue.h
浏览该文件的文档.
1
11#ifndef _UNI_MSG_QUEUE_H
12#define _UNI_MSG_QUEUE_H
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18#include "tuya_cloud_types.h"
19#include "sys_timer.h"
20
21typedef PVOID_T MSG_QUE_HANDLE; // message queue handle
22typedef USHORT_T MSG_ID; // message id
23typedef PVOID_T P_MSG_DATA; // message data
24typedef UINT_T MSG_DATA_LEN; // message data lenth
25
26#define UNVALUED_MSGID 0xffff // invalid message id
27
31typedef UINT_T MSG_TYPE;
32#define INSTANCY_MESSAGE 0 // instant message type
33#define NORMAL_MESSAGE 1 // normal message type
34
38typedef struct
39{
40 MSG_ID msgID; // message id
41 P_MSG_DATA pMsgData; // message data
42 MSG_DATA_LEN msgDataLen; // message data len
44
45// message processing callback
46typedef VOID(*MSG_CALLBACK)(MESSAGE *msg);
47
48struct s_tm_msg;
49typedef VOID(* TM_MSG_CB)(struct s_tm_msg *tm_msg); // timer message callback
50
54typedef struct s_tm_msg {
55 TIMER_ID timer; // timer id
56 MSG_QUE_HANDLE msgQueHandle; // timer queue handle
57 TM_MSG_CB cb; // timer callback function
58 MSG_ID msgID; // message id
59 VOID *data; // message data
61
65typedef struct {
66 MSG_ID *mid; // message id
67 MSG_CALLBACK msg_cb; // message callback
69
73typedef struct {
74 TM_MSG_S **tm_msg; //timer message info
75 TM_MSG_CB tmm_msg_cb; //timer message callback
77#ifdef __cplusplus
78}
79#endif /* __cplusplus */
80
81#endif
Init param of message
Definition: uni_msg_queue.h:39
message entry definition
Definition: uni_msg_queue.h:65
timer message entry definition
Definition: uni_msg_queue.h:73
timer message definition
Definition: uni_msg_queue.h:54
Common process - Initialization
struct s_tm_msg TM_MSG_S
timer message definition
UINT_T MSG_TYPE
Definition of message type
Definition: uni_msg_queue.h:31