/* * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ #pragma once #include "esp_openthread.h" #include "openthread/instance.h" #ifdef __cplusplus extern "C" { #endif /** * @brief The state handler to be called when OpenThread state changes * * @param[in] changed_flags The changed Openthread states * @param[in] ctx A pointer to application-specific context * */ void esp_openthread_netif_glue_state_callback(otChangedFlags changed_flags, void *ctx); /** * @brief This function updates the netif fds and timeouts to the main loop. * * @param[inout] mainloop The main loop context. * */ void esp_openthread_netif_glue_update(esp_openthread_mainloop_context_t *mainloop); /** * @brief This function performs the netif process. * * @param[in] instance The OpenThread instance. * @param[in] mainloop The main loop context. * * @return * - ESP_OK on success * - ESP_FAIL on OpenThread failure * - ESP_ERR_NO_MEM on memory allocation failure * */ esp_err_t esp_openthread_netif_glue_process(otInstance *instance, const esp_openthread_mainloop_context_t *mainloop); #ifdef __cplusplus } #endif