Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[deliverable/linux.git] / Documentation / media / uapi / rc / lirc-read.rst
CommitLineData
5377d91f
MH
1.. -*- coding: utf-8; mode: rst -*-
2
4ed030af 3.. _lirc-read:
5377d91f 4
8a6ba5c0
MCC
5***********
6LIRC read()
7***********
8
9Name
10====
11
12lirc-read - Read from a LIRC device
13
14
15Synopsis
16========
17
18.. code-block:: c
19
20 #include <unistd.h>
21
22
23.. cpp:function:: ssize_t read( int fd, void *buf, size_t count )
24
25
26Arguments
27=========
28
29``fd``
30 File descriptor returned by ``open()``.
31
32``buf``
33``count``
34
35
36Description
37===========
38
39:ref:`read() <lirc-read>` attempts to read up to ``count`` bytes from file
40descriptor ``fd`` into the buffer starting at ``buf``. If ``count`` is zero,
41:ref:`read() <lirc-read>` returns zero and has no other results. If ``count``
42is greater than ``SSIZE_MAX``, the result is unspecified.
5377d91f
MH
43
44The lircd userspace daemon reads raw IR data from the LIRC chardev. The
45exact format of the data depends on what modes a driver supports, and
46what mode has been selected. lircd obtains supported modes and sets the
bd6a63f2
MCC
47active mode via the ioctl interface, detailed at :ref:`lirc_func`.
48The generally preferred mode for receive is
49:ref:`LIRC_MODE_MODE2 <lirc-mode-mode2>`, in which packets containing an
50int value describing an IR signal are read from the chardev.
5377d91f
MH
51
52See also
53`http://www.lirc.org/html/technical.html <http://www.lirc.org/html/technical.html>`__
54for more info.
8a6ba5c0
MCC
55
56Return Value
57============
58
59On success, the number of bytes read is returned. It is not an error if
60this number is smaller than the number of bytes requested, or the amount
61of data required for one frame. On error, -1 is returned, and the ``errno``
62variable is set appropriately.
This page took 0.044441 seconds and 5 git commands to generate.