Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

comments on Arduino flush() method #8318

Merged
merged 2 commits into from
Sep 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cores/esp8266/HardwareSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class HardwareSerial: public Stream
{
return static_cast<int>(uart_tx_free(_uart));
}
void flush(void) override;
void flush(void) override; // wait for all outgoing characters to be sent, output buffer is empty after this call
size_t write(uint8_t c) override
{
return uart_write_char(_uart, c);
Expand Down
5 changes: 4 additions & 1 deletion cores/esp8266/Print.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ class Print {
size_t println(const Printable&);
size_t println(void);

virtual void flush() { /* Empty implementation for backward compatibility */ }
// flush():
// Empty implementation by default in Print::
// should wait for all outgoing characters to be sent, output buffer is empty after this call
virtual void flush() { }

// by default write timeout is possible (outgoing data from network,serial..)
// (children can override to false (like String))
Expand Down
2 changes: 1 addition & 1 deletion libraries/ESP8266WiFi/src/WiFiClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class WiFiClient : public Client, public SList<WiFiClient> {
size_t peekBytes(char *buffer, size_t length) {
return peekBytes((uint8_t *) buffer, length);
}
virtual void flush() override { (void)flush(0); }
virtual void flush() override { (void)flush(0); } // wait for all outgoing characters to be sent, output buffer should be empty after this call
virtual void stop() override { (void)stop(0); }
bool flush(unsigned int maxWaitMs);
bool stop(unsigned int maxWaitMs);
Expand Down
2 changes: 1 addition & 1 deletion libraries/ESP8266WiFi/src/WiFiUdp.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class WiFiUDP : public UDP, public SList<WiFiUDP> {
int read(char* buffer, size_t len) override { return read((unsigned char*)buffer, len); };
// Return the next byte from the current packet without moving on to the next byte
int peek() override;
void flush() override; // Finish reading the current packet
void flush() override; // wait for all outgoing characters to be sent, output buffer is empty after this call

// Return the IP address of the host who sent the current incoming packet
IPAddress remoteIP() override;
Expand Down