USB device stack

Fork of USBDevice by mbed official

Revision:
6:d0945750af57
Parent:
1:80ab0d068708
Child:
8:335f2506f422
diff -r d27e4c226965 -r d0945750af57 USBSerial/USBCDC.cpp
--- a/USBSerial/USBCDC.cpp	Sun Oct 14 15:08:52 2012 +0000
+++ b/USBSerial/USBCDC.cpp	Thu Dec 20 17:05:37 2012 +0000
@@ -30,6 +30,7 @@
 #define MAX_CDC_REPORT_SIZE MAX_PACKET_SIZE_EPBULK
 
 USBCDC::USBCDC(uint16_t vendor_id, uint16_t product_id, uint16_t product_release): USBDevice(vendor_id, product_id, product_release) {
+    terminal_connected = false;
     USBDevice::connect();
 }
 
@@ -52,8 +53,11 @@
             case CDC_SET_LINE_CODING:
                 transfer->remaining = 7;
                 success = true;
+                terminal_connected = true;
                 break;
             case CDC_SET_CONTROL_LINE_STATE:
+                if (terminal_connected)
+                    terminal_connected = false;
                 success = true;
                 break;
             default: