rust-embedded-community / usbd-serial

Work-in progress minimal CDC-ACM (USB serial port) class for usb-device
MIT License
118 stars 35 forks source link

Add option to build with IAD for composite device serial port #12

Closed conorpp closed 4 years ago

conorpp commented 4 years ago

This provides a quick solution to build a serial-port class with an interface association descriptor. So if the device is composite, Windows will work with the serial-port. #3

// for composite devices
let serial = usbd_serial::SerialPort::new_composite(usb_bus);

// for serial-port only devices
let serial = usbd_serial::SerialPort::new(usb_bus);

Tested working on Windows.

mvirkkunen commented 4 years ago

Thank you for the pull request, IADs are a good addition. However I'm going to go with PR #13, because it's not a breaking change (this adds a new required argument for a public constructor), and it's closer to what the next version of usb-device will do (it can auto-detect whether you need IADs or not).