Skip to content

Missing CDC_SEND_BREAK handling #15450

Open
@yp05327

Description

@yp05327

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Needs Triage

    Status

    Untriaged

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions