'How would I get the IPV4 address of a esp32 device when using AWS C IOT SDK

I'm building an application using the AWS SDK Mutual Auth demo as a starting point.

I want to get the IPV4 address of the device.

Normally I could use code such shown below to get the IP:

esp_netif_t *netif = **????**

esp_netif_ip_info_t ip_info;

esp_netif_get_ip_info(netif, &ip_info);

printf("My IP: " IPSTR "\n", IP2STR(&ip_info.ip));

However in the context of the demo example how do I initialize netif as the sdk takes care of starting the wifi?

I've tried to look for were it all takes place, but I wondering if I'm missing something about how the SDK is expected to be used?

Thanks for any help you can provide!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source