From 00e9c78585a4692e017f06bf699a8116f6b8a18d Mon Sep 17 00:00:00 2001 From: TD-er Date: Sat, 14 Sep 2024 16:15:59 +0200 Subject: [PATCH 1/2] Fix missing virtual declarations in Stream.h Fixes some changes made in PR #10328 --- cores/esp32/Stream.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cores/esp32/Stream.h b/cores/esp32/Stream.h index 123694f6fc6..fb994c981b5 100644 --- a/cores/esp32/Stream.h +++ b/cores/esp32/Stream.h @@ -61,6 +61,7 @@ class Stream : public Print { Stream() { _timeout = 1000; } + virtual ~Stream() {} // parsing methods @@ -105,8 +106,8 @@ class Stream : public Print { float parseFloat(LookaheadMode lookahead = SKIP_ALL, char ignore = NO_IGNORE_CHAR); // float version of parseInt - size_t readBytes(char *buffer, size_t length); // read chars from stream into buffer - size_t readBytes(uint8_t *buffer, size_t length) { + virtual size_t readBytes(char *buffer, size_t length); // read chars from stream into buffer + virtual size_t readBytes(uint8_t *buffer, size_t length) { return readBytes((char *)buffer, length); } // terminates if length characters have been read or timeout (see setTimeout) @@ -120,7 +121,7 @@ class Stream : public Print { // returns the number of characters placed in the buffer (0 means no valid data found) // Arduino String functions to be added here - String readString(); + virtual String readString(); String readStringUntil(char terminator); protected: From 70186196db9ea3348709ce25c7d010105614db86 Mon Sep 17 00:00:00 2001 From: TD-er Date: Sat, 14 Sep 2024 16:45:47 +0200 Subject: [PATCH 2/2] Remove the virtual destructor as Print class has one As pointed out by @JAndrassy --- cores/esp32/Stream.h | 1 - 1 file changed, 1 deletion(-) diff --git a/cores/esp32/Stream.h b/cores/esp32/Stream.h index fb994c981b5..37346cdb99f 100644 --- a/cores/esp32/Stream.h +++ b/cores/esp32/Stream.h @@ -61,7 +61,6 @@ class Stream : public Print { Stream() { _timeout = 1000; } - virtual ~Stream() {} // parsing methods