Fix working with CDC-ACM (ttyACMx) / CH347T #229
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, we have a serious problem with all CDC-ACM serial ports. For example, with the very popular USB-to-RS232 adapter CH347T:
We cannot set any modem control signals because the BRK signal is optional in CDC-ACM implementations.
See the Linux CDC-ACM driver source: https://github.com/torvalds/linux/blob/6fab32bb6508abbb8b7b1c5498e44f0c32320ed5/drivers/usb/class/cdc-acm.c#L930
A good solution is simply to ignore the ioctl error if it's EOPNOTSUPP.
Example: https://github.com/torvalds/linux/blob/2e590d67c2d803d603ac00b85f2fab235df52a1b/drivers/tty/tty_io.c#L2486