ARMmbed / mbed-os

Arm Mbed OS is a platform operating system designed for the internet of things
https://mbed.com
Other
4.66k stars 2.97k forks source link

Missing CDC_SEND_BREAK handling #15450

Open yp05327 opened 1 year ago

yp05327 commented 1 year ago

Description of defect

My PC side application needs to send a break signal to the board, but mbed-os will not handle it, and return failure. I did some changes to the source for just making it return success, but I think it will be wonderful if this can be supported officially.

Related codes: https://github.com/ARMmbed/mbed-os/blob/f0d909094097c6b6e201c6e7c87bcd3b64209f05/drivers/usb/source/USBCDC.cpp#L29-L31 ↑ add the following codes.

#define CDC_SEND_BREAK 0x23

https://github.com/ARMmbed/mbed-os/blob/f0d909094097c6b6e201c6e7c87bcd3b64209f05/drivers/usb/source/USBCDC.cpp#L218-L243 ↑ add a new case in this switch

case CDC_SEND_BREAK:
    /* Do something here */
    result = Success; 
    break; 

Target(s) affected by this defect ?

I think all targets affected by this defect. I'm using Arduino Giga r1 wifi

Toolchain(s) (name and version) displaying this defect ?

I'm using ArduinoCore-mbed v4.0.6

What version of Mbed-os are you using (tag or sha) ?

ArduinoCore-mbed v4.0.6 is based on mbed-os-6.17.0 I think

What version(s) of tools are you using. List all that apply (E.g. mbed-cli)

arduino ide

How is this defect reproduced ?

You should prepare an PC application. The application will connect to the board by CDC, and at last send CDC_SEND_BREAK request, and the board will response failed because it is not defined.

mbedmain commented 1 year ago

@yp05327 thank you for raising this issue.Please take a look at the following comments:

What target(s) are you using? What toolchain(s) are you using? What Mbed OS version are you using? It would help if you could also specify the versions of any tools you are using? How can we reproduce your issue?

NOTE: If there are fields which are not applicable then please just add 'n/a' or 'None'. This indicates to us that at least all the fields have been considered. Please update the issue header with the missing information.

yp05327 commented 11 months ago

Updated the issue header with the missing information as much as possible.