Now we are going places!
I don't use String types, and this (among other reasons) is why. I use character arrays.
char readString[20];
If you pass readString as a parameter now, it will work. At least it should. I have not used the .trim() function before, but now I might try it.
You will probably need to redo your ad-a-character routine to that array. Like this:
int charCount;
char readString[20];
// Then in the loop
charCount = 0;
readString[0] = 0;
while(client.available())
{
char c = client.read();
if(charCount < 19)
{
// store character
readString[charCount] = c;
charCount++;
// set terminating zero
readString[charCount] = 0;
}
}
// If you need to empty the array,
charCount = 0;
readString[0] = 0;
edit: I added the readString zero terminator when I set charCount to zero.