From 5bfd17f2319aca251e3304c858247229331c30f4 Mon Sep 17 00:00:00 2001 From: mattb5906 Date: Fri, 18 Mar 2016 22:26:37 +0000 Subject: [PATCH] Add getTimeout accessor method. --- hardware/arduino/avr/cores/arduino/Stream.h | 3 ++- hardware/arduino/sam/cores/arduino/Stream.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/hardware/arduino/avr/cores/arduino/Stream.h b/hardware/arduino/avr/cores/arduino/Stream.h index db71bb6cd..e4fd4338c 100644 --- a/hardware/arduino/avr/cores/arduino/Stream.h +++ b/hardware/arduino/avr/cores/arduino/Stream.h @@ -66,7 +66,8 @@ class Stream : public Print // parsing methods void setTimeout(unsigned long timeout); // sets maximum milliseconds to wait for stream data, default is 1 second - + unsigned long getTimeout(void) { return _timeout; } + bool find(char *target); // reads data from the stream until the target string is found bool find(uint8_t *target) { return find ((char *)target); } // returns true if target string is found, false if timed out (see setTimeout) diff --git a/hardware/arduino/sam/cores/arduino/Stream.h b/hardware/arduino/sam/cores/arduino/Stream.h index db71bb6cd..3582a1818 100644 --- a/hardware/arduino/sam/cores/arduino/Stream.h +++ b/hardware/arduino/sam/cores/arduino/Stream.h @@ -66,6 +66,7 @@ class Stream : public Print // parsing methods void setTimeout(unsigned long timeout); // sets maximum milliseconds to wait for stream data, default is 1 second + unsigned long getTimeout(void) { return _timeout; } bool find(char *target); // reads data from the stream until the target string is found bool find(uint8_t *target) { return find ((char *)target); }