t

Fork of mbed-dev by mbed official

Revision:
168:e84263d55307
Parent:
149:156823d33999
Child:
169:9672193075cf
diff -r c97ed07ec1a8 -r e84263d55307 drivers/Serial.h
--- a/drivers/Serial.h	Thu Jun 08 15:02:37 2017 +0100
+++ b/drivers/Serial.h	Wed Jun 21 17:46:44 2017 +0100
@@ -18,7 +18,7 @@
 
 #include "platform/platform.h"
 
-#if DEVICE_SERIAL
+#if defined (DEVICE_SERIAL) || defined(DOXYGEN_ONLY)
 
 #include "Stream.h"
 #include "SerialBase.h"
@@ -27,14 +27,13 @@
 
 namespace mbed {
 /** \addtogroup drivers */
-/** @{*/
 
 /** A serial port (UART) for communication with other serial devices
  *
  * Can be used for Full Duplex communication, or Simplex by specifying
  * one pin as NC (Not Connected)
  *
- * @Note Synchronization level: Thread safe
+ * @note Synchronization level: Thread safe
  *
  * Example:
  * @code
@@ -48,6 +47,7 @@
  *     pc.printf("Hello World\n");
  * }
  * @endcode
+ * @ingroup drivers
  */
 class Serial : public SerialBase, public Stream {
 
@@ -81,6 +81,23 @@
      */
     Serial(PinName tx, PinName rx, int baud);
 
+    /* Stream gives us a FileHandle with non-functional poll()/readable()/writable. Pass through
+     * the calls from the SerialBase instead for backwards compatibility. This problem is
+     * part of why Stream and Serial should be deprecated.
+     */
+    bool readable()
+    {
+        return SerialBase::readable();
+    }
+    bool writable()
+    {
+        return SerialBase::writeable();
+    }
+    bool writeable()
+    {
+        return SerialBase::writeable();
+    }
+
 protected:
     virtual int _getc();
     virtual int _putc(int c);
@@ -95,5 +112,3 @@
 #endif
 
 #endif
-
-/** @}*/