1
votes

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 one, 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?

1
Just realized that stackoverflow probably isn't the best place to ask this...Oystein

1 Answers

2
votes

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.