11#ifndef __BASE_EVENT_H__
12#define __BASE_EVENT_H__
14#include "tuya_iot_config.h"
28#ifndef EVENT_NAME_MAX_LEN
29#define EVENT_NAME_MAX_LEN (16)
36#define EVENT_DESC_MAX_LEN (32)
43#define SUBSCRIBE_TYPE_NORMAL 0
44#define SUBSCRIBE_TYPE_EMERGENCY 1
45#define SUBSCRIBE_TYPE_ONETIME 2
72 struct tuya_list_head node;
83 struct tuya_list_head node;
84 struct tuya_list_head subscribe_root;
97 struct tuya_list_head event_root;
98 struct tuya_list_head free_subscribe_root;
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_event_init(VOID)
event initialization
BYTE_T SUBSCRIBE_TYPE_E
subscriber type
Definition: base_event.h:42
#define EVENT_DESC_MAX_LEN
max length of event description
Definition: base_event.h:36
OPERATE_RET ty_publish_event(CONST CHAR_T *name, VOID_T *data)
: publish event
OPERATE_RET ty_unsubscribe_event(CONST CHAR_T *name, CONST CHAR_T *desc, EVENT_SUBSCRIBE_CB cb)
: unsubscribe event
INT_T(* EVENT_SUBSCRIBE_CB)(VOID_T *data)
event subscribe callback function type
Definition: base_event.h:61
#define EVENT_NAME_MAX_LEN
max length of event name
Definition: base_event.h:29
the event manage node
Definition: base_event.h:93
the event node
Definition: base_event.h:79
the event dispatch raw data
Definition: base_event.h:51
the subscirbe node
Definition: base_event.h:67
Common process - adapter the mutex api provide by OS