larskanis/libusb

naive question regarding libusb

Closed this issue · 2 comments

Rich Morin asked per mail:

First, thanks for writing and supporting libusb.  Using it, I was able to detect and characterize a iKKEGOL 10633 three-pedal USB Foot Switch which I recently purchased.

I've been thinking about building a "smart" USB switch, based on a RasPi 3B.  Basically, it would act as a programmable crossbar switch, allowing any device to talk to any computer.  For example, it might let a braille display be used by several computers, controlled by a foot switch.

My naive question has to do with things like plug gender, protocol roles, etc.  Is there a relatively easy way (in hardware and software) for a computer to act as a USB device?

Raspberry devices have got a OTG capable USB hub. So in theory they should be able to act as a USB device. The linux kernel has the subsystem for USB gadgets to make use of of it.

Unfortunately libusb supports USB master mode only. It is not usable to receive URBs as a slave from other masters. Possibly there is another library which handles the slave mode so that you could combine it with libusb to forward URBs to the target device.

Sorry I can't help more! Possibly the developers of the C-libusb library can help you more. Nevertheless please post an update, if you get something working.

I hope this issue is solved. If not feel free to reopen.