2022-12-26 02:48:07 -05:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "esp_openthread.h"
|
2023-04-14 03:38:57 -04:00
|
|
|
#include "openthread/ip6.h"
|
2022-12-26 02:48:07 -05:00
|
|
|
#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);
|
|
|
|
|
2023-04-14 03:38:57 -04:00
|
|
|
/**
|
|
|
|
* @brief This function judges the target address is openthread mesh local or not.
|
|
|
|
*
|
|
|
|
* @param[in] address The address.
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* - True if the address is openthread mesh local, otherwise false
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
bool is_openthread_internal_mesh_local_addr(const otIp6Address *address);
|
|
|
|
|
2022-12-26 02:48:07 -05:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|