USB device stack

Dependents:   mbed-mX-USB-TEST1 USBMSD_SD_HID_HelloWorld HidTest MIDI_usb_bridge ... more

Legacy Warning

This is an mbed 2 library. To learn more about mbed OS 5, visit the docs.

Pull requests against this repository are no longer supported. Please raise against mbed OS 5 as documented above.

Revision:
70:2c525a50f1b6
Parent:
51:deafa44182d9
--- a/USBSerial/USBSerial.h	Fri Nov 11 17:59:00 2016 +0000
+++ b/USBSerial/USBSerial.h	Thu Jul 20 10:14:36 2017 +0100
@@ -22,7 +22,7 @@
 #include "USBCDC.h"
 #include "Stream.h"
 #include "CircBuffer.h"
-
+#include "Callback.h"
 
 /**
 * USBSerial example
@@ -83,6 +83,13 @@
     */
     uint8_t available();
 
+     /**
+    * Check if the terminal is connected.
+    *
+    * @returns connection status
+    */
+    bool connected();
+
     /** Determine if there is a character available to read
      *
      *  @returns
@@ -153,7 +160,7 @@
     }
 
 private:
-    FunctionPointer rx;
+    Callback<void()> rx;
     CircBuffer<uint8_t,128> buf;
     void (*settingsChangedCallback)(int baud, int bits, int parity, int stop);
 };