You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was reading an earlier post of yours regarding WifiTelnetToSerial. Great catch on client.flush in that post too by the way ;-)
I am trying to modify this to be a simple TCP server on port 5252.
I am able to get the client to connect and send packets to this server but where I'm really struggling is to get the data that the client sends into a char array.
How do I change this (or what needs to be changed or set ) : //get data from the telnet client and push it to the UART while(serverClients[i].available()) Serial.write(serverClients[i].read());
To be able to do that ?
I have these variables on the server : //declare vars for receive char hDroid1[5] = { '\0' }; //4 or less digits/keys eg 1234 + NULL char pDroid1[3] = { '\0' }; //2 digits/keys eg 12 + NULL char ooDroid1[4] = { '\0' }; //3 or less digits/keys eg 123 + NULL char devDroid1[5] = { '\0' }; //4 or less digits/keys eg 9999 + NULL char allDroid[18] = { '\0' }; //total array count including NULL's
the data I receive from the client is 1234,12,123,999
and I would collect them from the allDroid array like this :
sscanf(allDroid, "%s,%s,%s,%s", &hDroid1, &pDroid1, &ooDroid1, &devDroid1);
which then would allow me to print them individually and or compare each one.
No description provided.
The text was updated successfully, but these errors were encountered: