diff options
author | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-07-12 09:35:26 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-07-12 09:43:04 -0300 |
commit | bd6a63f2e69ea16851a99b200cd2039186173775 (patch) | |
tree | 847ea21e7790244cc946d1d551658888714e28be /Documentation/media/uapi/rc/lirc-write.rst | |
parent | 048eb3ef7580ef5dd64c74a319e58b1c8568ed68 (diff) |
[media] doc-rst: reorganize LIRC ReST files
Reorganize the LIRC rst files, using "-" instead of "_" on
their names, and creating a separate chapter for syscalls.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'Documentation/media/uapi/rc/lirc-write.rst')
-rw-r--r-- | Documentation/media/uapi/rc/lirc-write.rst | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/Documentation/media/uapi/rc/lirc-write.rst b/Documentation/media/uapi/rc/lirc-write.rst new file mode 100644 index 000000000000..dcba3b1bee6e --- /dev/null +++ b/Documentation/media/uapi/rc/lirc-write.rst @@ -0,0 +1,58 @@ +.. -*- coding: utf-8; mode: rst -*- + +.. _lirc-write: + +************ +LIRC write() +************ + +Name +==== + +lirc-write - Write to a LIRC device + + +Synopsis +======== + +.. code-block:: c + + #include <unistd.h> + + +.. cpp:function:: ssize_t write( int fd, void *buf, size_t count ) + + +Arguments +========= + +``fd`` + File descriptor returned by ``open()``. + +``buf`` +``count`` + + +Description +=========== + +:ref:`write() <lirc-write>` writes up to ``count`` bytes to the device +referenced by the file descriptor ``fd`` from the buffer starting at +``buf``. + +The data written to the chardev is a pulse/space sequence of integer +values. Pulses and spaces are only marked implicitly by their position. +The data must start and end with a pulse, therefore, the data must +always include an uneven number of samples. The write function must +block until the data has been transmitted by the hardware. If more data +is provided than the hardware can send, the driver returns ``EINVAL``. + + +Return Value +============ + +On success, the number of bytes read is returned. It is not an error if +this number is smaller than the number of bytes requested, or the amount +of data required for one frame. On error, -1 is returned, and the ``errno`` +variable is set appropriately. The generic error codes are described at the +:ref:`Generic Error Codes <gen-errors>` chapter. |