espressif / esp-aws-iot

AWS IoT SDK for ESP32 based chipsets
Apache License 2.0
257 stars 154 forks source link

How would I get the IPV4 address of a device within the Mutual Auth demo example (CA-193) #97

Open readysteadygo2006 opened 2 years ago

readysteadygo2006 commented 2 years ago

Hi,

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?

Thanks for any help you can provide!