diff --git a/WifiESP.cpp b/WifiESP.cpp index a461e43..b46a13d 100644 --- a/WifiESP.cpp +++ b/WifiESP.cpp @@ -37,7 +37,7 @@ static void handleError(void* arg, AsyncClient* client, int8_t error) { } static void handleData(void* arg, AsyncClient* client, void *data, size_t len) { - DIAG(F("data received from client %s"), client->remoteIP().toString().c_str()); + //DIAG(F("data received from client %s"), client->remoteIP().toString().c_str()); uint8_t clientId; for (clientId=0; clientIdread(); if (clientId>=0) { int count=outboundRing->count(); - DIAG(F("Wifi reply client=%d, count=%d"), clientId,count); + //DIAG(F("Wifi reply client=%d, count=%d"), clientId,count); { char buffer[count+1]; - for(uint8_t i=0;iread(); if (c >= 0) buffer[i] = (char)c; @@ -173,8 +173,11 @@ void WifiESP::loop() { } } buffer[count]=0; - DIAG(F("SEND:%s COUNT:%d"),buffer,count); - sendData(clientId, buffer, count); + //DIAG(F("SEND:%s COUNT:%d"),buffer,count); + while (! sendData(clientId, buffer, count)) { + DIAG(F("senData fail")); + yield(); + } } }