de-vri-es / serial2-rs

Cross platform serial ports for Rust
Other
41 stars 10 forks source link

port info #22

Open thewh1teagle opened 6 months ago

thewh1teagle commented 6 months ago

It will be very useful to get port info such as vid / hid name, etc... so I can detect my device automatically. Same as here: https://github.com/serialport/serialport-rs/blob/819b64000e8c9758589443bc1af08e97a7bde2f2/src/lib.rs#L701

de-vri-es commented 6 months ago

I agree! This is related to #12 and should probably be solved with the same solution.

The main reason I haven't done it yet is the added complexity. But it would be a very useful feature.

I think we can not guarantee support for all platforms though. So I think all fields of the SerialPortInfo struct need to be options.

And we probably can't guarantee identical metadata across platforms for the same hardware either. But this can be solved with documentation.

wc7086 commented 1 month ago

Currently, I am using https://crates.io/crates/serial_enumerator as a temporary solution.