Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing CDC_SEND_BREAK handling #15450

Open
yp05327 opened this issue Aug 28, 2023 · 2 comments
Open

Missing CDC_SEND_BREAK handling #15450

yp05327 opened this issue Aug 28, 2023 · 2 comments

Comments

@yp05327
Copy link

yp05327 commented Aug 28, 2023

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:

#define CDC_SET_LINE_CODING 0x20
#define CDC_GET_LINE_CODING 0x21
#define CDC_SET_CONTROL_LINE_STATE 0x22

↑ add the following codes.

#define CDC_SEND_BREAK 0x23

/* Only process class-specific requests */
if (setup->bmRequestType.Type == CLASS_TYPE) {
switch (setup->bRequest) {
case CDC_GET_LINE_CODING:
result = Send;
data = _cdc_line_coding;
size = 7;
break;
case CDC_SET_LINE_CODING:
result = Receive;
data = _cdc_new_line_coding;
size = 7;
break;
case CDC_SET_CONTROL_LINE_STATE:
if (setup->wValue & CLS_DTR) {
_change_terminal_connected(true);
} else {
_change_terminal_connected(false);
}
result = Success;
break;
default:
result = Failure;
break;
}
}

↑ 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
Copy link

@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
Copy link
Author

yp05327 commented Oct 10, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Untriaged
Status: Needs Triage
Development

No branches or pull requests

2 participants