Converting IPAddress to String
Posted: Thu Jul 09, 2015 6:59 am
Hi,
I want to convert an IPAddress to a string in the Arduino IDE
I've tried the following
This gives the error:
What is the right way of doing this?
Thanks
I want to convert an IPAddress to a string in the Arduino IDE
I've tried the following
Code: Select all
IPAddress ipno;
char ipno2[26] ;
ipno = WiFi.localIP();
sprintf(ipno2, "%d.%d.%d.%d", ipno[0], ipno[1], ipno[2], ipno[3]);
This gives the error:
Code: Select all
Arduino: 1.6.5 (Windows 8.1), Board: "Generic ESP8266 Module, 80 MHz, 115200, 512K (64K SPIFFS)"
<cut a lot of noise>
AdvancedWebServerMMA.ino:78:2: error: cannot pass objects of non-trivially-copyable type 'class IPAddress' through '...'
cannot pass objects of non-trivially-copyable type 'class IPAddress' through '...'
What is the right way of doing this?
Thanks