I’m making an application that checks battery, controls lightning and sidetone on peripherals. To accomplish this, I use hidraw because it lets me control devices connected via USB as well as bluetooth, something that libusb does not offer. In my testing, the interface raw-usb only works with libusb.
Why not use the already available interface hidraw?
The hidraw interface requires you to either specify a path or vid, pid and a symlink path. I could work around this in my program by listing all supported devices in snapcraft.yaml and point all symlinks to one specific folder. This however creates another problem. Whenever a new device is added, the snapcraft.yaml is changed and would have to be reviewed again (I think this is how that works?).
Add a new interface like ‘hidraw-all’ or something similar to enable users to open any hidraw device. Essentially giving the same permissions as raw-usb but for /dev/hidraw* devices.
I found one snap that uses the interface raw-usb to access all connected USB devices, and that is ‘usb-reset’.