Convert incoming char* array into String data type
Posted: Tue Feb 02, 2016 3:51 am
I am using the SMING framework. I have a tcpServer function which receives data from a TCP port. I would like to convert the incoming char *data into String data type.
The contents of rx_data is rubbish. How to make rx_data into a proper string?
Code: Select all
bool tcpServerClientReceive(TcpClient& client, char *data, int size)
{
String rx_data;
rx_data = String(data);
Serial.printf("rx_data=%s\r",rx_data);
}
The contents of rx_data is rubbish. How to make rx_data into a proper string?