Search code examples
linuxconfigurationusbuserspace

Linux tool to send a SET_CONFIGURATION message to a device connected to the USB bus


I have developed a kernel driver for a USB device. Such a device has some pins that can provide functionality both as CDC ACM serial port or as input buttons. So to implement that I had to use two different USB configuration descriptors.

The driver works as expected, but I have to hardcode the chosen setup before compiling and loading the firmware to the micro-controller. I am searching a mechanism to change that device configuration from userspace.

I read about a SET_CONFIGURATION message on USB documentation, but coudn't find any Linux tool to send such kind of standard USB messages from userspace to the USB bus.

Does some of you (with more experience on this topic) know some userspace Linux tool to send a SET_CONFIGURATION message to a device connected to the USB bus?

Thanks in advance! :)


Solution

  • This github repo resolves my issue:

    https://github.com/avtolstoy/usbtool