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

tuya simple event module 更多...

#include "tuya_iot_config.h"
#include "tuya_os_adapter.h"
#include "tuya_base_utilities.h"
#include "base_event_info.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(* event_subscribe_cb) (void *data)
 event subscribe callback function type
 
typedef BYTE_T SUBSCRIBE_TYPE_E
 subscriber type
 

函数

int ty_event_init (void)
 event initialization 更多...
 
int ty_publish_event (const char *name, void *data)
 : publish event 更多...
 
int ty_subscribe_event (const char *name, const char *desc, const event_subscribe_cb cb, SUBSCRIBE_TYPE_E type)
 : subscribe event 更多...
 
int ty_unsubscribe_event (const char *name, const char *desc, event_subscribe_cb cb)
 : unsubscribe event 更多...
 

详细描述

tuya simple event module

版本
1.0
日期
2019-10-30

函数说明

◆ ty_event_init()

int ty_event_init ( void  )

event initialization

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

◆ ty_publish_event()

int ty_publish_event ( const char *  name,
void *  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()

int ty_subscribe_event ( const char *  name,
const char *  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()

int ty_unsubscribe_event ( const char *  name,
const char *  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