2023-01-08 21:46:51 -05:00
|
|
|
/*
|
2024-01-30 21:24:05 -05:00
|
|
|
* SPDX-FileCopyrightText: 2018-2024 Espressif Systems (Shanghai) CO LTD
|
2023-01-08 21:46:51 -05:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
2018-10-26 01:14:19 -04:00
|
|
|
|
2023-08-07 04:15:28 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2018-10-26 01:14:19 -04:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Defines for declaring and defining event base
|
2023-01-08 21:46:51 -05:00
|
|
|
#define ESP_EVENT_DECLARE_BASE(id) extern esp_event_base_t const id
|
|
|
|
#define ESP_EVENT_DEFINE_BASE(id) esp_event_base_t const id = #id
|
2018-10-26 01:14:19 -04:00
|
|
|
|
|
|
|
// Event loop library types
|
|
|
|
typedef const char* esp_event_base_t; /**< unique pointer to a subsystem that exposes events */
|
|
|
|
typedef void* esp_event_loop_handle_t; /**< a number that identifies an event with respect to a base */
|
2024-01-30 21:24:05 -05:00
|
|
|
typedef void (*esp_event_handler_t)(void* event_handler_arg,
|
|
|
|
esp_event_base_t event_base,
|
|
|
|
int32_t event_id,
|
|
|
|
void* event_data); /**< function called when an event is posted to the queue */
|
2020-01-16 23:37:41 -05:00
|
|
|
typedef void* esp_event_handler_instance_t; /**< context identifying an instance of a registered event handler */
|
2018-10-26 01:14:19 -04:00
|
|
|
|
|
|
|
// Defines for registering/unregistering event handlers
|
|
|
|
#define ESP_EVENT_ANY_BASE NULL /**< register handler for any event base */
|
|
|
|
#define ESP_EVENT_ANY_ID -1 /**< register handler for any event id */
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|