You could make that output easier to understand:
void printData(char* data, int len)
{
Serial.print("WiFi data: [");
Serial.print(data);
Serial.println("]");
if (len-- > 0)
{
char *resultat= NULL;
resultat = strtok(data, "s"); //cut data into pieces when s is found
if( !resultat)
{
// otput debug error if nothing of the sort is found
Serial.println("not working!");
}
while (resultat != NULL)
{
Serial.println("resultat: [");
Serial.print(resultat);
Serial.print("]");
resultat = strtok(NULL, "s");
}
}
}
Connexion wifi lanceeHTTP/1.1 200 OK
Date: Wed, 25 Apr 2012 12:33:30 GMT
Server: Apache
Last-Modified: Wed, 25 Apr 2012 09:46:23 GMT
ETag: "816e4162-64-4be7dbe893ec6"
Accept-Ranges
Is the first part of the data received (as near as I can tell).
What part(s) of that do you want to extract?
: bytes
145 100 54 </b
Content-Length: 100
Connection: close
Content-Type: text/html
Appears to be more input data. This looks like what you are interested in.
You are going to need to use strstr() to see if data contains "span". If it does, then get the token that ends with ", and throw it away. Get the token that ends with ", and save it (it will be 'r'). Then, get the token that ends with >, and throw it away. Get the token that ends with < (145) and convert it to an int. Use the saved value to determine where to store it.