Skip to content

Commit

Permalink
fix(examples): Fixed esp_netif_next() warning with IDFv5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
david-cermak committed Jan 8, 2024
1 parent 9df8664 commit 52a34c2
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -109,7 +109,11 @@ static esp_netif_t *get_netif_with_esp_index(int index)
{
esp_netif_t *netif = NULL;
int counter = 0;
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 2, 0)
while ((netif = esp_netif_next_unsafe(netif)) != NULL) {
#else
while ((netif = esp_netif_next(netif)) != NULL) {
#endif
if (counter == index) {
return netif;
}
Expand All @@ -124,7 +128,11 @@ static int get_esp_netif_index(esp_netif_t *esp_netif)
{
esp_netif_t *netif = NULL;
int counter = 0;
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 2, 0)
while ((netif = esp_netif_next_unsafe(netif)) != NULL) {
#else
while ((netif = esp_netif_next(netif)) != NULL) {
#endif
if (esp_netif == netif) {
return counter;
}
Expand Down

0 comments on commit 52a34c2

Please sign in to comment.