esp-idf 5.3.1 vs 5.4.1 and esp_netif_get_ip_info

Gaston1980
Posts: 41
Joined: Sun Oct 06, 2024 10:26 am

esp-idf 5.3.1 vs 5.4.1 and esp_netif_get_ip_info

Postby Gaston1980 » Wed Jul 02, 2025 4:31 pm

Hi to all,
I got this peacec of code working under esp-idf 5.3.1 without any errors:

Code: Select all

    esp_netif_get_ip_info(my_staif, &ipInfo.ip);
    ESP_LOGW(TAG4,"My IPV4: " IPSTR "\n", IP2STR(&ipInfo.ip));
but now under esp-idf 5.4.1 i got error message:

Code: Select all

error: passing argument 2 of 'esp_netif_get_ip_info' from incompatible pointer type [-Wincompatible-pointer-types]
   84 |     esp_netif_get_ip_info(my_staif, &ipInfo.ip);
      |                                     ^~~~~~~~~~
      |                                     |
      |                                     esp_ip4_addr_t * {aka struct esp_ip4_addr *}
      note: expected 'esp_netif_ip_info_t *' but argument is of type 'esp_ip4_addr_t *' {aka 'struct esp_ip4_addr *'}
  463 | esp_err_t esp_netif_get_ip_info(esp_netif_t *esp_netif, esp_netif_ip_info_t *ip_info);
but the variables are defined like this:

Code: Select all

esp_netif_ip_info_t ipInfo;
esp_netif_t *my_staif ;
how do properly use esp_netif_get_ip_info under esp-idf 5.4.1?

Regards
Gastón

MicroController
Posts: 2672
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: esp-idf 5.3.1 vs 5.4.1 and esp_netif_get_ip_info

Postby MicroController » Wed Jul 02, 2025 4:53 pm

how do properly use esp_netif_get_ip_info

Code: Select all

esp_netif_get_ip_info(my_staif, &ipInfo);

Gaston1980
Posts: 41
Joined: Sun Oct 06, 2024 10:26 am

Re: esp-idf 5.3.1 vs 5.4.1 and esp_netif_get_ip_info

Postby Gaston1980 » Wed Jul 02, 2025 6:09 pm

thanks for your help. Cheers

Who is online

Users browsing this forum: Google [Bot] and 5 guests