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

fix(client): Make flush() call clear() and deprecate it #10242

Merged
merged 1 commit into from
Aug 28, 2024
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
4 changes: 3 additions & 1 deletion libraries/Network/src/NetworkClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,9 @@ int NetworkClient::read() {
return data;
}

void NetworkClient::flush() {}
void NetworkClient::flush() {
clear();
}

size_t NetworkClient::write(const uint8_t *buf, size_t size) {
int res = 0;
Expand Down
1 change: 1 addition & 0 deletions libraries/Network/src/NetworkClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class NetworkClient : public ESPLwIPClient {
size_t write(const uint8_t *buf, size_t size);
size_t write_P(PGM_P buf, size_t size);
size_t write(Stream &stream);
[[deprecated("Use clear() instead.")]]
void flush(); // Print::flush tx
int available();
int read();
Expand Down
4 changes: 3 additions & 1 deletion libraries/Network/src/NetworkUdp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,9 @@ size_t NetworkUDP::write(const uint8_t *buffer, size_t size) {
return i;
}

void NetworkUDP::flush() {}
void NetworkUDP::flush() {
clear();
}

int NetworkUDP::parsePacket() {
if (rx_buffer) {
Expand Down
1 change: 1 addition & 0 deletions libraries/Network/src/NetworkUdp.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class NetworkUDP : public UDP {
int endPacket();
size_t write(uint8_t);
size_t write(const uint8_t *buffer, size_t size);
[[deprecated("Use clear() instead.")]]
void flush(); // Print::flush tx
int parsePacket();
int available();
Expand Down
Loading