From f56e3bec9e8f850aa20c8dd70eb7df09904a2a25 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Mon, 8 Aug 2022 13:00:53 +0200 Subject: [PATCH] eliminate wrong ringread due to peek (eliminated peek as well) - new version --- GITHUB_SHA.h | 2 +- WifiESP32.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/GITHUB_SHA.h b/GITHUB_SHA.h index c9cbede..924cebb 100644 --- a/GITHUB_SHA.h +++ b/GITHUB_SHA.h @@ -1 +1 @@ -#define GITHUB_SHA "PORTX-HAL-20220807-1" +#define GITHUB_SHA "PORTX-HAL-20220808" diff --git a/WifiESP32.cpp b/WifiESP32.cpp index c1383d7..12820dc 100644 --- a/WifiESP32.cpp +++ b/WifiESP32.cpp @@ -268,7 +268,7 @@ void WifiESP::loop() { WiThrottle::loop(outboundRing); // something to write out? - clientId=outboundRing->peek(); + clientId=outboundRing->read(); if (clientId >= 0) { if ((unsigned int)clientId > clients.size()) { // something is wrong with the ringbuffer position @@ -280,20 +280,20 @@ void WifiESP::loop() { for(int i=0;iread(); if (c < 0) { - DIAG(F("Ringread fail at %d"),i); + DIAG(F("Ringread fail in discarding data for client %d at pos %d"),clientId, i); break; } } outboundRing->info(); + } else { + DIAG(F("No clientId where expected: Ring beyond rescue")); } - DIAG(F("Ring beyond rescue")); } else { // We have data to send in outboundRing // and we have a valid clientId. // First read it out to buffer // and then look if it can be sent because // we can not leave it in the ring for ever - outboundRing->read(); // read over peek() int count=outboundRing->count(); { char buffer[count+1];