From 19b4893b5f64f40224939c6849b389dc1a5db5cb Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Tue, 28 Sep 2021 21:08:41 +0200 Subject: [PATCH] counter should be int, not uint8_t --- WifiESP.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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(); + } } }