1 .. -*- coding: utf-8; mode: rst -*-
12 lirc-write - Write to a LIRC device
23 .. cpp:function:: ssize_t write( int fd, void *buf, size_t count )
30 File descriptor returned by ``open()``.
39 :ref:`write() <lirc-write>` writes up to ``count`` bytes to the device
40 referenced by the file descriptor ``fd`` from the buffer starting at
43 The data written to the chardev is a pulse/space sequence of integer
44 values. Pulses and spaces are only marked implicitly by their position.
45 The data must start and end with a pulse, therefore, the data must
46 always include an uneven number of samples. The write function must
47 block until the data has been transmitted by the hardware. If more data
48 is provided than the hardware can send, the driver returns ``EINVAL``.
54 On success, the number of bytes read is returned. It is not an error if
55 this number is smaller than the number of bytes requested, or the amount
56 of data required for one frame. On error, -1 is returned, and the ``errno``
57 variable is set appropriately. The generic error codes are described at the
58 :ref:`Generic Error Codes <gen-errors>` chapter.