开发者

A Linux USB driver for a generic 2-way comm device

What would be the best existing Linux device driver to use for a generic device that requires 2-way communication (custom protocol)? Preferably bulk transfer, as fairly large blocks will need to be transmitted.

I have considered using mass storage, but I'm unsure if it requires file system handling?

I have also considered modem, but I can't seem to find much information on it (most people who ask are just told that "This is not how you connect to the Internet". Since I'm not going to connect to any "internets" this is rather unhelpful to me). If anyone can point me to some more detailed information on this on开发者_高级运维e, preferably with C or C++ examples, I'd be grateful.

Linux also seems to have a generic serial communications driver, though it does not seem to have bulk transfer? I am also unsure if it provides the speed of the other drivers, since it is apparently targeted at USB->serial converters?


Bulk transfer is the correct choice for large transfers "as fast as the device/PC can handle it".

Well you could get away with just CDC ACM profile. But this has some issues: You need the user to select the correct serial device /dev/ttyACMx.

If you only need to talk to your application, I recommend using libusb. This way you don't need a kernel driver, and you can talk to individual bulk endpoints of your device.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜