feat(openthread): handle MeshCoP mDNS service in state change callback

This commit is contained in:
Xu Si Yu
2025-05-29 16:21:36 +08:00
parent a83147ddb0
commit 5bfd50ca37
4 changed files with 76 additions and 1 deletions
@@ -76,6 +76,14 @@ esp_netif_t *esp_openthread_get_backbone_netif(void);
*/
esp_err_t esp_openthread_set_meshcop_instance_name(const char *instance_name);
/**
* @brief Gets the meshcop(e) instance name.
*
* @return The instance name.
*
*/
const char* esp_openthread_get_meshcop_instance_name(void);
#ifdef __cplusplus
}
#endif
@@ -0,0 +1,41 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include "esp_openthread.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Publishes the OpenThread meshcop service in mDNS
*
* @param[in] instance_name Instance name of meshcop mDNS service
*
* @return
* - ESP_OK success
* - ESP_ERR_NO_MEM memory error
* - ESP_FAIL failed to add service
*
*/
esp_err_t esp_openthread_publish_meshcop_mdns(const char *instance_name);
/**
* @brief Removes the OpenThread meshcop service in mDNS
*
* @return
* - ESP_OK success
* - ESP_ERR_NO_MEM memory error
* - ESP_FAIL failed to remove service
*
*/
esp_err_t esp_openthread_remove_meshcop_mdns(void);
#ifdef __cplusplus
}
#endif