ryankurte / rust-streamdeck

libusb based driver for Elgato StreamDeck devices
Mozilla Public License 2.0
57 stars 24 forks source link

Feature request: detect Streamdeck function. #27

Open dragonblade316 opened 5 months ago

dragonblade316 commented 5 months ago

I thought having a built-in way to automatically detect attached stream decks could be useful for people trying to make custom streamdeck clients (including myself). This way they would not need to deal with Hidapi. I ran into this problem yesterday when I tried updating the library to 0.8.0 (and by extension updating Hidapi) and found that my HIDapi streamdeck detection code had broken. A built-in way to automatically detect attached stream decks would address headaches like this.

I would be willing to take a shot at this if needed. I was wondering why this had not been implemented before. They all use the same VID and the PIDs are documented. The code does not seem too complicated (keyword: seem). Is there a reason this feature has not been implemented?

Thx

ryankurte commented 5 months ago

hey, seems like a useful feature! i didn't implement it because how you configure the streamdeck typically depends on what kind it is, but, auto-detection with filters should work just as well.

i usually end up with a list method that takes filters and returns a list / iterator of device info objects (including vid, pid, and path because this is the only unique identifier) that can be used to connect to the device, then it's up to the user of the library to apply filters / indexing / handle multiple devices as they see fit.