On my Linux system I have 2 hiddev files (there could be more in the future):
> ls /dev/usb
hiddev0 hiddev1 lp2
And I have a bunch of USB devices:
> lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 120b:8207 Linux 3.10.14 with dwc2-gadget hidpos
Bus 001 Device 003: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 004: ID 0483:4c43 STMicroelectronics PROTOCOL
Bus 001 Device 005: ID 0519:2013 Star Micronics Co., Ltd USB Printer P
Bus 001 Device 006: ID 2575:c300 Weida Hi-Tech Co., Ltd. CoolTouch® System
Bus 001 Device 007: ID 13d3:3548 IMC Networks Bluetooth Radio
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
I need to determine (in .NET C#) which hiddev entry corresponds to the following device:
Bus 001 Device 004: ID 0483:4c43 STMicroelectronics PROTOCOL
I’ve been working the problem with ChatGpt, but I keep getting issues with its code. Plus, between having me include two separate NuGet packages, and then making me include libc in order to call ioctl, I’m starting to doubt its solution. At best I think it came up with an over-engineered one, at worst it’s leading me on a wild goose chase.
Does anyone know a simple solution for this? Or really any solution that works, although preferably one that doesn’t bloat my install package with unnecessary libraries.
With regards to access rights, I can’t have my app run with sudo, but I can set up any and all necessary privileges for my user.
Thank you