1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #17085 from bergzand/pr/cdcacm/stall_on_no_line_coding

usbus/cdc_acm: Return stall on line coding not supported
This commit is contained in:
Francisco 2021-11-02 13:04:26 +01:00 committed by GitHub
commit 1ef44844e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -259,6 +259,11 @@ static int _control_handler(usbus_t *usbus, usbus_handler_t *handler,
usbus_cdcacm_device_t *cdcacm = (usbus_cdcacm_device_t*)handler;
switch(setup->request) {
case USB_CDC_MGNT_REQUEST_SET_LINE_CODING:
if (!(cdcacm->coding_cb)) {
/* Line coding not supported, return STALL */
DEBUG("CDCACM: line coding not supported\n");
return -1;
}
if ((state == USBUS_CONTROL_REQUEST_STATE_OUTDATA) &&
(setup->length == sizeof(usb_req_cdcacm_coding_t))) {
size_t len = 0;