fpagliughi / rust-industrial-io

Rust interface to the Linux Industrial I/O subsystem
MIT License
45 stars 21 forks source link

Feature request: add support for device labels. #24

Open AntoineZenKraken opened 1 year ago

AntoineZenKraken commented 1 year ago

The libiiohas an iio_device_get_label() function that is useful to find a device that is linked to a particular use.

Basically, you add a label attribute to the DTS node (see biding here) and you can use this label to lookup the right device. This can be useful to esly map the virtual device to the real one in the application, to have a unique reference that does not change (in contract to the ID, if you add another device).

It would be nice to have this functionality available from Rust too! I think this should not be too complicated to implement. It just need to mimic the behavior of method industrial_io::device::Device::name().