Ok after much struggling i was able to find the strstr "span", and get a token that ends with " or < .
However, i have no clue as to how to throw away the first token ending with ", then finding the next one ending with " (should be r ).
I've not been able to parse the data into an int either, though i imagine it has to do something with the atoi function?
oops, forgot to copy/paste the code:
char * resultat=NULL;
char * resultattwo=NULL;
void printData(char* data, int len) {
/*while (len-- > 0) {
Serial.println(data);
}*/
char * spanstring = "span";
resultat = strstr(data, spanstring);
if (resultat != NULL){
Serial.println("I found strstr");
Serial.println(resultat);
char * tokenstringone = "<";
resultattwo = strtok(resultat, tokenstringone);
Serial.println("I found strtok");
Serial.println(resultattwo);
// char * token = strtok(data, "\"");
}
}
and the ouput:
Connexion wifi lanceeI found strstr
span id="r">145
100
54
</b
I found strtok
span id="r">145
I found strstr
span id="r">145
I found strtok
span id="r">145
I found strstr
span id="r">145
I found strtok
span id="r">145
why is it repeating itself? Oo