Description
Related area
WiFi / Ethernet
Hardware specification
All ESP32 versions
Is your feature request related to a problem?
Arduino describe Stream::flush()
as "sending all outgoing outstanding data"
https://www.arduino.cc/reference/en/language/functions/communication/stream/streamflush/
Stream
is the base interface class for all IO implementations (WiFi, HarwareSerial, USBCDC, SPI, Wire)
So also in Serial
arduino interface behaviour is maintained:
https://www.arduino.cc/reference/en/language/functions/communication/serial/flush/
HardwareSerial
here in Esp32 is conformant too:
arduino-esp32/cores/esp32/HardwareSerial.cpp
Lines 472 to 475 in 0a26a8c
arduino-esp32/cores/esp32/esp32-hal-uart.c
Lines 753 to 766 in 0a26a8c
But then WiFiClient::flush()
is still maintaining old arduino behaviour of clearing RX input:
arduino-esp32/libraries/WiFi/src/WiFiClient.cpp
Lines 162 to 167 in 0a26a8c
This is not compliant with the Stream
interface
Describe the solution you'd like
WiFiClient::flush()
to actually send al outstanding data to the client to the other end without clearing the input buffer
Describe alternatives you've considered
Overloading WiFiClient
class with a custom flush function
Additional context
Yes is true that original WiFiClient::flush()
from arduino define a different behaviour
https://www.arduino.cc/reference/en/libraries/wifi/client.flush/
But it is also true that that documentation is both obsolete and it don't even adhere to the Stream::flush()
interface from which it inherit
https://www.arduino.cc/reference/en/language/functions/communication/stream/streamflush/
I have checked existing list of Feature requests and the Contribution Guide
- I confirm I have checked existing list of Feature requests and Contribution Guide.
(closest is WiFiClient - rename flush() to clear() (breaking) #8871 but it don't actually address the problem)
Metadata
Metadata
Assignees
Type
Projects
Status