create Serial Port Drivers use DriverKit

I have a simple USB device that needs a driver for reading/writing data. It's a single endpoint with only one configuration, one interface, and one endpoint. I need the driver accessible through a /dev/tty* type serial interface.

Is there any sample code out there for such a device?

Replies

I am not aware of any sample code, which is really a shame. Without sample code, writing USB serial device drivers is a very obscure science.

However, if you can influence the code on the USB device you are better off implementing the USB CDC ACM protocol. That way your device appears under /dev/tty* and /dev/cu* without the need to write a device driver. And best of all, it works on Windows and Linux as well - again without device drivers.

And on macOS, you probably don't want to use the /dev/tty* device but rather the /dev/cu* device. /dev/tty* is from the old days when you had a modem connected to your serial port and your software would become active if there was an incoming call.