Fix issue in CDC device class driver where received data the size of the data endpoin...
[pub/lufa.git] / Demos / Host / ClassDriver / CDCHost / CDCHost.c
index cf0a9f3..7aa8dee 100644 (file)
@@ -103,6 +103,13 @@ int main(void)
                                USB_HostState = HOST_STATE_Configured;\r
                                break;\r
                        case HOST_STATE_Configured:\r
+                               if (CDC_Host_BytesReceived(&VirtualSerial_CDC_Interface))\r
+                               {\r
+                                       /* Echo received bytes from the attached device through the USART */\r
+                                       while (CDC_Host_BytesReceived(&VirtualSerial_CDC_Interface))\r
+                                         putchar(CDC_Host_ReceiveByte(&VirtualSerial_CDC_Interface));\r
+                               }\r
+                       \r
                                break;\r
                }\r
        \r