From a984b581a8ad093b55ec9f2d4677afdd77bf4705 Mon Sep 17 00:00:00 2001 From: Zach Eveland Date: Sun, 1 Apr 2012 12:54:35 -0400 Subject: added Boolean operators to HardwareSerial and CDC to test whether the port is ready to send data. Mostly useful for Leonardo - simple way to test whether the port is actually opened by an application and ready to receive data. For Serial objects attached to real UARTs always returns true. --- cores/arduino/USBAPI.h | 1 + 1 file changed, 1 insertion(+) (limited to 'cores/arduino/USBAPI.h') diff --git a/cores/arduino/USBAPI.h b/cores/arduino/USBAPI.h index 5169e65..f66cb16 100644 --- a/cores/arduino/USBAPI.h +++ b/cores/arduino/USBAPI.h @@ -39,6 +39,7 @@ public: virtual int read(void); virtual void flush(void); virtual size_t write(uint8_t); + operator bool(); }; extern Serial_ Serial; -- cgit v1.2.3-18-g5258