TuyaOS
结构体 | 宏定义 | 类型定义 | 函数
base_event.h 文件参考

tuya simple event module 更多...

#include "tuya_iot_config.h"
#include "tuya_base_utilities.h"
#include "base_event_info.h"
#include "tal_mutex.h"
base_event.h 的引用(Include)关系图:
此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

结构体

struct  EVENT_MANAGE_T
 the event manage node 更多...
 

宏定义

#define EVENT_DESC_MAX_LEN   (32)
 max length of event description
 
#define EVENT_NAME_MAX_LEN   (16)
 max length of event name
 
#define SUBSCRIBE_TYPE_EMERGENCY   1
 
#define SUBSCRIBE_TYPE_NORMAL   0
 
#define SUBSCRIBE_TYPE_ONETIME   2
 

类型定义

typedef INT_T(* EVENT_SUBSCRIBE_CB) (VOID_T *data)
 event subscribe callback function type
 
typedef BYTE_T SUBSCRIBE_TYPE_E
 subscriber type
 

函数

OPERATE_RET ty_event_init (VOID)
 event initialization 更多...
 
OPERATE_RET ty_publish_event (CONST CHAR_T *name, VOID_T *data)
 : publish event 更多...
 
OPERATE_RET ty_subscribe_event (CONST CHAR_T *name, CONST CHAR_T *desc, CONST EVENT_SUBSCRIBE_CB cb, SUBSCRIBE_TYPE_E type)
 : subscribe event 更多...
 
OPERATE_RET ty_unsubscribe_event (CONST CHAR_T *name, CONST CHAR_T *desc, EVENT_SUBSCRIBE_CB cb)
 : unsubscribe event 更多...
 

详细描述

tuya simple event module

版本
1.0
日期
2019-10-30

函数说明

◆ ty_event_init()

OPERATE_RET ty_event_init ( VOID  )

event initialization

返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ ty_publish_event()

OPERATE_RET ty_publish_event ( CONST CHAR_T *  name,
VOID_T *  data 
)

: publish event

参数
[in]nameevent name
[in]dataevent data
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ ty_subscribe_event()

OPERATE_RET ty_subscribe_event ( CONST CHAR_T *  name,
CONST CHAR_T *  desc,
CONST EVENT_SUBSCRIBE_CB  cb,
SUBSCRIBE_TYPE_E  type 
)

: subscribe event

参数
[in]nameevent name
[in]descsubscribe description
[in]cbsubscribe callback function
[in]typesubscribe type
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h

◆ ty_unsubscribe_event()

OPERATE_RET ty_unsubscribe_event ( CONST CHAR_T *  name,
CONST CHAR_T *  desc,
EVENT_SUBSCRIBE_CB  cb 
)

: unsubscribe event

参数
[in]nameevent name
[in]descsubscribe description
[in]cbsubscribe callback function
返回
OPRT_OK on success. Others on error, please refer to tuya_error_code.h