cdev_write_buffer()

Write the contents of the buffer to the device

Synopsis:

#include <qvm/cdev.h>
int cdev_write_buffer(struct cdev_state *cds)

Arguments:

cds
A pointer to a structure with the state of the character device

Library:

Provided by qvm; no external library is required.

Description:

The buffer is the buffer referenced by the cdev_state structure's out.buff member. You can use this function only if you have passed a non-zero size for the buffers you created when you called cdev_setup().

If you aren't providing your own buffer, then you must call this function when handling the CDEV_OUTPUT_AVAILABLE_PULSE_CODE pulse.

Returns:

If successful, the number of bytes written; otherwise -1 (minus one).