O'Reilly logo

OS X and iOS Kernel Programming by Douglas Clarke, Ole Henry Halvorsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Serial Data Transfer

The remaining methods to be implemented from the IOSerialDriverSync interface are the data transfer methods. The serial driver will be provided with data to be transmitted over the serial port through the method enqueueData(), and the data that the driver has received from the serial port is provided to clients through the dequeueData() method.

When a user space process writes data to a serial port, it is first handled in the kernel by the IOSerialBSDClient class, which is responsible for passing the data on to the serial port driver. The IOSerialBSDClient will provide the data to the serial driver by calling its enqueueData() method, which has the following signature:

IOReturn  enqueueData(UInt8 *buffer, UInt32 size, UInt32 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required