Skip to content

Commit 98134a4

Browse files
committed
Merge pull request arduino#4718 from mattb5906/new-feature/stream-timeout-get-4680
Add getTimeout accessor method.
2 parents a5caee6 + 5bfd17f commit 98134a4

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

hardware/arduino/avr/cores/arduino/Stream.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ class Stream : public Print
6666
// parsing methods
6767

6868
void setTimeout(unsigned long timeout); // sets maximum milliseconds to wait for stream data, default is 1 second
69-
69+
unsigned long getTimeout(void) { return _timeout; }
70+
7071
bool find(char *target); // reads data from the stream until the target string is found
7172
bool find(uint8_t *target) { return find ((char *)target); }
7273
// returns true if target string is found, false if timed out (see setTimeout)

hardware/arduino/sam/cores/arduino/Stream.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ class Stream : public Print
6666
// parsing methods
6767

6868
void setTimeout(unsigned long timeout); // sets maximum milliseconds to wait for stream data, default is 1 second
69+
unsigned long getTimeout(void) { return _timeout; }
6970

7071
bool find(char *target); // reads data from the stream until the target string is found
7172
bool find(uint8_t *target) { return find ((char *)target); }

0 commit comments

Comments
 (0)