cdcacm: Activate data out endpoint on DTE present signal#12536
cdcacm: Activate data out endpoint on DTE present signal#12536benpicco merged 2 commits intoRIOT-OS:masterfrom
Conversation
Why add a reference to the out endpoint ? I thought this endpoint could be accessible through usbus_interface_t field ? |
Good point, however, I think I need a proper getter for that first. Something along the lines of usbus_endpoint_t *usbus_interface_find_endpoint(usb_ep_type_t type, usb_ep_dir_t dir);Which would return a reference to the first endpoint matching the spec. This way we don't depend too much on the order the endpoints are added to the interface. |
I think this is the way to go, this is more generic and this may be reuse in another implementation later. |
0a55de9 to
1d5d1cb
Compare
|
rebased to include the descriptor bug fix from #12535 |
1d5d1cb to
e2ce187
Compare
|
And reordered the commits to keep stuff properly incremental |
|
This looks good, please squash. |
e2ce187 to
1d7032a
Compare
|
squashed! |
benpicco
left a comment
There was a problem hiding this comment.
Code looks good, tested successfully on same54-xpro and Linux
Contribution description
This PR modifies the CDC ACM code to signal the data out endpoint to be ready when the host has indicated that an application opened the serial console, DTE present in CDC ACM terminology.
This mainly prevents the code from calling the ready function when no USB host is present and at least after the low level endpoint is initialized by usbus. The downside is that the cdcacm struct requires a reference to the endpoint.
Testing procedure
Verify that
tests/usbus_cdc_acmis still working and that RIOT shell commands still work over the CDC ACM function.Issues/PRs references
Testing should be a bit easier with #12535 included