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