How to communicate with the USB Host from a Linux USB Client

眉间皱痕 提交于 2020-01-03 03:44:26

问题


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:


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.



来源:https://stackoverflow.com/questions/24076207/how-to-communicate-with-the-usb-host-from-a-linux-usb-client

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!