tuya simple event module
更多...
#include "tuya_iot_config.h"
#include "tuya_os_adapter.h"
#include "tuya_base_utilities.h"
#include "base_event_info.h"
浏览源代码.
|
|
#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
|
| |
tuya simple event module
- 版本
- 1.0
- 日期
- 2019-10-30
- 版权所有
- Copyright (c) tuya.inc 2019
◆ 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] | name | event name |
| [in] | data | event data |
- 返回
- OPRT_OK on success. Others on error, please refer to tuya_error_code.h
◆ ty_subscribe_event()
: subscribe event
- 参数
-
| [in] | name | event name |
| [in] | desc | subscribe description |
| [in] | cb | subscribe callback function |
| [in] | type | subscribe type |
- 返回
- OPRT_OK on success. Others on error, please refer to tuya_error_code.h
◆ ty_unsubscribe_event()
: unsubscribe event
- 参数
-
| [in] | name | event name |
| [in] | desc | subscribe description |
| [in] | cb | subscribe callback function |
- 返回
- OPRT_OK on success. Others on error, please refer to tuya_error_code.h