27 #ifndef __EVENTLOOP_H__ 28 #define __EVENTLOOP_H__ 30 #include <libtuv/uv.h> 42 EVENTLOOP_INVALID_PARAM = -1,
44 EVENTLOOP_OUT_OF_MEMORY = -3,
45 EVENTLOOP_LOOP_FAIL = -4,
46 EVENTLOOP_NOT_FINISHED = -5,
47 EVENTLOOP_OPERATION_FAIL = -6,
48 EVENTLOOP_INVALID_HANDLE = -7,
66 EL_EVENT_WIFI_OFF = 2,
78 #define EVENTLOOP_CALLBACK_STOP 0 79 #define EVENTLOOP_CALLBACK_CONTINUE 1 113 typedef bool (*
event_callback)(
void *registered_cb_data,
void *received_event_data);
el_event_type_e
Event type used in Event Loop.
uv_signal_t el_event_t
EventLoop Event structure.
int eventloop_loop_run(void)
Run the loop of its own task.
int eventloop_del_event_handler(el_event_t *handle)
Delete registered handler for event.
bool(* timeout_callback)(void *data)
EventLoop Timeout Callback.
el_result_error_e
Error Type of Result Value returned from Event Loop.
int eventloop_delete_timer(el_timer_t *timer)
Delete specific timer.
uv_timer_t el_timer_t
EventLoop Timer structure.
int eventloop_thread_safe_function_call(thread_safe_callback func, void *cb_data)
Callback is added at the each eventloop to be called thread safely. .
int eventloop_loop_stop(void)
Stop the loop of its own task.
el_timer_t * eventloop_add_timer(unsigned int timeout, bool repeat, timeout_callback func, void *cb_data)
Create timer to call the function in the given period of time.
void(* thread_safe_callback)(void *data)
EventLoop Thread Safe Callback.
el_event_t * eventloop_add_event_handler(int type, event_callback func, void *cb_data)
Set event callback which will be called a certain event occur.
int eventloop_send_event(int type, void *event_data, int data_size)
Send an event.
el_timer_t * eventloop_add_timer_async(unsigned int timeout, bool repeat, timeout_callback func, void *cb_data)
Create timer to call the function in the given period of time asynchronously.
uv_loop_t el_loop_t
EventLoop Loop structure.
bool(* event_callback)(void *registered_cb_data, void *received_event_data)
EventLoop Event Callback This is specific type for callback function used in eventloop_add_event_hand...