Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Integrating Return Value class in apis
  • Loading branch information
andreagilardoni committed Jul 21, 2025
commit 9a9ef248454f2e0300333e0eec280c569d4dff5e
8 changes: 4 additions & 4 deletions api/Client.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ class Client : public Stream {
virtual ErrorCode connect(const char *host, uint16_t port) =0;
virtual size_t write(uint8_t) =0;
virtual size_t write(const uint8_t *buf, size_t size) =0;
virtual int available() = 0;
virtual int read() = 0;
virtual int read(uint8_t *buf, size_t size) = 0;
virtual int peek() = 0;
virtual ReturnValue available() = 0;
virtual ReturnValue read() = 0;
virtual ReturnValue read(uint8_t *buf, size_t size) = 0;
virtual ReturnValue peek() = 0;
virtual void flush() = 0;
virtual void stop() = 0;
virtual uint8_t connected() = 0;
Expand Down
4 changes: 2 additions & 2 deletions api/HardwareSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ class HardwareSerial : public Stream
virtual ErrorCode begin(unsigned long baudrate, uint16_t config) = 0;
virtual void end() = 0;
virtual int available(void) = 0;
virtual int peek(void) = 0;
virtual int read(void) = 0;
virtual ReturnValue peek(void) = 0;
virtual ReturnValue read(void) = 0;
virtual void flush(void) = 0;
virtual size_t write(uint8_t) = 0;
using Print::write; // pull in write(str) and write(buf, size) from Print
Expand Down
6 changes: 3 additions & 3 deletions api/Stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ class Stream : public Print
int peekNextDigit(LookaheadMode lookahead, bool detectDecimal); // returns the next numeric digit in the stream or -1 if timeout

public:
virtual int available() = 0;
virtual int read() = 0;
virtual int peek() = 0;
virtual ReturnValue available() = 0;
virtual ReturnValue read() = 0;
virtual ReturnValue peek() = 0;

Stream() {_timeout=1000;}

Expand Down