tuya simple event module
更多...
#include "tuya_iot_config.h"
#include "tuya_base_utilities.h"
#include "base_event_info.h"
#include "tal_mutex.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_T(* | EVENT_SUBSCRIBE_CB) (VOID_T *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()
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] | 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()
OPERATE_RET ty_unsubscribe_event |
( |
CONST CHAR_T * |
name, |
|
|
CONST CHAR_T * |
desc, |
|
|
EVENT_SUBSCRIBE_CB |
cb |
|
) |
| |
: 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