1
votes

The host part will be a PC program made from c# in which I will use LibUSBdotnet to do the communication. My problem is how do I make the Linux side pickup and respond. I don't really know where to start. Whenever I try to search for it, all result show are "how linux communicates with a device attached to it". Or it does not matter if a device is host or client, because they utilize the same pipes/bus? Can I use something in "/dev/usb***"?

I have seen "libusb" which I believe is the linux cousin of libusbdotnet. Can I somehow use this library? If anyone can show me the right direction, I would really appreciate it.

1
Maybe create a Linux USB Gadget driver; the Gadget Zero driver within the Linux kernel may be a place to start.mstrthealias
So I tried looking into usb gadgets and it opened up a lot of things. I also saw that it has "gadget serial" and tried to install that to try the usb communication via serial. But it seems that g_serial would not play nice with g_mass_storage. Does this mean that as long as I am using g_mass_storage it would not go well with other drivers? Even if I make a driver base on gadget zero, they might not work together?Naze Kimi
You can look into the "Multifunction Composite Gadget" (multi.c) which implements multiple gadget devices on a single UDC. IIRC, not all UDC drivers support this function.mstrthealias
@myninjaname, ok I got to install the g_multi module. Now it seems I have to find a proper composite driver or .inf so windows can detect it properly?Naze Kimi
I haven't used the multi_gadget so I'm not able to help you there. My best advice may be to make sure you can get the multi gadget to function between two Linux systems. Once you know your UDC functions correctly with the multi gadget, then proceed to making it work with Windows.mstrthealias

1 Answers

1
votes

AFAIK libusb is the library for usb-host side, not for usb-device side. So you cannot use it in your case. I suggest the same as myninjaname said - to analyse one of the Linux usb gadget drivers as a start point.