Printing IP address

zliudr
Posts: 357
Joined: Thu Oct 03, 2019 5:15 am

Printing IP address

Postby zliudr » Fri Mar 05, 2021 9:49 pm

I'm going through the WiFi migration document. What I don't understand is the use of IPSTR and IP2STR macros. I expanded them in eclipse and it's a long of stuff with a do-while loop. What are they intended to do? Doc doesn't explain what. It discourages the use of the other method. But if you just want printing, fine. What if you want to put it in a file etc.? You want a string.

https://docs.espressif.com/projects/esp ... t-handlers

Are the two IPSTR IP2STR macros just saving us a definition of a char array to hold the returned C-string by doing escape code to erase the "got ip" and reprint it with the ip address one char at a time?

Who is online

Users browsing this forum: Google [Bot], MicroController and 141 guests