I am wondering whats the right way to do that .
I have a function that has to send some wifi data , i am calling this function once .
This function send some data to a wifi module via serial , wait for a ">" respond , and then send him the data .
I wonder how should i wait to the ">" respond inside that function , so here it is :
String thisdata="HTTP/1.1 200 OK\r\n Content-Type:application/json\r\n";
String toSend="AT+CIPSEND=0,";
int dlen=thisdata.length();
toSend+=dlen;
toSend+="\r\n";
wifiSerial.println(toSend);
// here i sent this : AT+CIPSEND=0,50
// now i have to wait for the incoming wifi , to the sign ">"
String wifiContent="";
int readWifiIndex=0;
boolean hasdata=0;
while( wifiSerial.available() )
{
wifiContent[readWifiIndex]=wifiSerial.read();
readWifiIndex++;
delay(10);
hasdata=1;
}
// did i had the ">" sign ??? if yes do something, if no , check wifi serial again.