send buffered data when connected to USB CDC ACM serial port

This commit is contained in:
King Kévin 2016-01-29 00:26:12 +01:00
parent 875e0de18b
commit 3a76222050
1 changed files with 3 additions and 2 deletions

View File

@ -206,10 +206,11 @@ static int cdcacm_control_request(usbd_device *usbd_dev, struct usb_setup_data *
switch (req->bRequest) {
case USB_CDC_REQ_SET_CONTROL_LINE_STATE: {
/*
bool dtr = (req->wValue & (1 << 0)) ? true : false;
bool rts = (req->wValue & (1 << 1)) ? true : false;
*/
if (dtr || rts) { // host opened serial port
usbd_ep_write_packet(usb_device, 0x82, NULL, 0); // start transmitting
}
/* this Linux cdc_acm driver requires this to be implemented
* even though it's optional in the CDC spec, and we don't
* advertise it in the ACM functional descriptor.