From 0e1d7a5c329d83cb17963a0dc96867baa17e4d4e Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Thu, 12 Mar 2026 16:35:54 +0800 Subject: [PATCH] feat(wifi): add new api to return home channel info --- components/esp_wifi/include/esp_wifi.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/components/esp_wifi/include/esp_wifi.h b/components/esp_wifi/include/esp_wifi.h index d88298e17c7..5894489c0c5 100644 --- a/components/esp_wifi/include/esp_wifi.h +++ b/components/esp_wifi/include/esp_wifi.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -805,6 +805,20 @@ esp_err_t esp_wifi_set_channel(uint8_t primary, wifi_second_chan_t second); */ esp_err_t esp_wifi_get_channel(uint8_t *primary, wifi_second_chan_t *second); +/** + * @brief Get the home channel of device + * + * @param primary store primary channel + * @param[out] second store second channel + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start + * - ESP_ERR_INVALID_ARG: invalid argument + */ +esp_err_t esp_wifi_get_home_channel(uint8_t *primary, wifi_second_chan_t *second); + /** * @brief configure country info *