I have a character array called storebuffer
that contains data from a POST submission and its in the format ssid=abcdef&pswd=ghijk
. I wanted to extract everything after ssid=
into one array called acqSSID
and the portion after &pswd=
into another array called acqPaswd
. I tried using this but it does not seem to be working. MAX_STORE_BUFFER_LEN is 255. Can anyone help?
int ctr = 0;
for (ctr = 5; ctr < MAX_STORE_BUFFER_LEN; ctr++)
{
if ( (storebuffer[ctr] == '&') && (storebuffer[ctr+1] == 'p') && (storebuffer[ctr+2] == 's') && (storebuffer[ctr+3] == 'w') && (storebuffer[ctr+4] == 'd') && (storebuffer[ctr+5] == '=') )
{
break;
}
acqSSID[ctr] = storebuffer[ctr];
}
Serial.print("acqSSID: ");
Serial.println(acqSSID);
Serial.print("ctr: ");
Serial.println(ctr);