rHsphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget4/translations/zh_CN/userspace-api/media/rc/lirc-readmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget4/translations/zh_TW/userspace-api/media/rc/lirc-readmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget4/translations/it_IT/userspace-api/media/rc/lirc-readmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget4/translations/ja_JP/userspace-api/media/rc/lirc-readmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget4/translations/ko_KR/userspace-api/media/rc/lirc-readmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget4/translations/sp_SP/userspace-api/media/rc/lirc-readmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(hCSPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-laterh]hCSPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-later}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhhN/var/lib/git/docbuild/linux/Documentation/userspace-api/media/rc/lirc-read.rsthKubhtarget)}(h.. _lirc-read:h]h}(h]h ]h"]h$]h&]refid lirc-readuh1hhKhhhhhhubhsection)}(hhh](htitle)}(h LIRC read()h]h LIRC read()}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hNameh]hName}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhK ubh paragraph)}(h#lirc-read - Read from a LIRC deviceh]h#lirc-read - Read from a LIRC device}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubeh}(h]nameah ]h"]nameah$]h&]uh1hhhhhhhhK ubh)}(hhh](h)}(hSynopsish]hSynopsis}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh literal_block)}(h#include h]h#include }hjsbah}(h]h ]h"]h$]h&]hhforcelanguagechighlight_args}uh1jhhhKhjhhubhindex)}(hhh]h}(h]h ]h"]h$]h&]entries](singleRC.read (C function) c.RC.readhNtauh1j&hjhhhNhNubhdesc)}(hhh](hdesc_signature)}(h/ssize_t read( int fd, void *buf, size_t count )h]hdesc_signature_line)}(h-ssize_t read(int fd, void *buf, size_t count)h](h)}(hhh]h desc_sig_name)}(hssize_th]hssize_t}(hjMhhhNhNubah}(h]h ]nah"]h$]h&]uh1jKhjHubah}(h]h ]h"]h$]h&] refdomainj#reftype identifier reftargetjOmodnameN classnameN c:parent_keysphinx.domains.c LookupKey)}data](ji ASTIdentifier)}jdRCsbNjq)}jdreadsb c.RC.readesbuh1hhjDhhhhhKubhdesc_sig_space)}(h h]h }(hj}hhhNhNubah}(h]h ]wah"]h$]h&]uh1j{hjDhhhhhKubh desc_name)}(hreadh]jL)}(hjxh]hread}(hjhhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhjubah}(h]h ](sig-namedescnameeh"]h$]h&]hhuh1jhjDhhhhhKubhdesc_parameterlist)}(h!(int fd, void *buf, size_t count)h](hdesc_parameter)}(hint fdh](hdesc_sig_keyword_type)}(hinth]hint}(hjhhhNhNubah}(h]h ]ktah"]h$]h&]uh1jhjubj|)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1j{hjubjL)}(hfdh]hfd}(hjhhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhjubeh}(h]h ]h"]h$]h&]noemphhhuh1jhjubj)}(h void *bufh](j)}(hvoidh]hvoid}(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1jhjubj|)}(h h]h }(hjhhhNhNubah}(h]h ]jah"]h$]h&]uh1j{hjubhdesc_sig_punctuation)}(h*h]h*}(hj hhhNhNubah}(h]h ]pah"]h$]h&]uh1jhjubjL)}(hbufh]hbuf}(hjhhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhjubeh}(h]h ]h"]h$]h&]noemphhhuh1jhjubj)}(h size_t counth](h)}(hhh]jL)}(hsize_th]hsize_t}(hj4hhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhj1ubah}(h]h ]h"]h$]h&] refdomainj#reftypejd reftargetj6modnameN classnameNjhjk)}jn](jrNjv c.RC.readesbuh1hhj-ubj|)}(h h]h }(hjShhhNhNubah}(h]h ]jah"]h$]h&]uh1j{hj-ubjL)}(hcounth]hcount}(hjahhhNhNubah}(h]h ]jXah"]h$]h&]uh1jKhj-ubeh}(h]h ]h"]h$]h&]noemphhhuh1jhjubeh}(h]h ]h"]h$]h&]hhuh1jhjDhhhhhKubeh}(h]h ]h"]h$]h&]hh add_permalinkuh1jBsphinx_line_type declaratorhj>hhhhhKubah}(h]j5ah ](sig sig-objecteh"]h$]h&] is_multiline _toc_parts) _toc_namehuh1j<hhhKhj9hhubh desc_content)}(hhh]h}(h]h ]h"]h$]h&]uh1jhj9hhhhhKubeh}(h]h ](j#functioneh"]h$]h&]domainj#objtypejdesctypejnoindex noindexentrynocontentsentryuh1j7hhhjhNhNubeh}(h]synopsisah ]h"]synopsisah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h Argumentsh]h Arguments}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubhdefinition_list)}(hhh](hdefinition_list_item)}(h/``fd`` File descriptor returned by ``open()``. h](hterm)}(h``fd``h]hliteral)}(hjh]hfd}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhKhjubh definition)}(hhh]h)}(h'File descriptor returned by ``open()``.h](hFile descriptor returned by }(hjhhhNhNubj)}(h ``open()``h]hopen()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKhjubj)}(h``buf`` Buffer to be filled h](j)}(h``buf``h]j)}(hjh]hbuf}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhKhjubj)}(hhh]h)}(hBuffer to be filledh]hBuffer to be filled}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj3ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKhjhhubj)}(h&``count`` Max number of bytes to read h](j)}(h ``count``h]j)}(hjVh]hcount}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjTubah}(h]h ]h"]h$]h&]uh1jhhhK"hjPubj)}(hhh]h)}(hMax number of bytes to readh]hMax number of bytes to read}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK"hjkubah}(h]h ]h"]h$]h&]uh1jhjPubeh}(h]h ]h"]h$]h&]uh1jhhhK"hjhhubeh}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h] argumentsah ]h"] argumentsah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h Descriptionh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK%ubh)}(hX:c:func:`read()` attempts to read up to ``count`` bytes from file descriptor ``fd`` into the buffer starting at ``buf``. If ``count`` is zero, :c:func:`read()` returns zero and has no other results. If ``count`` is greater than ``SSIZE_MAX``, the result is unspecified.h](h)}(h:c:func:`read()`h]j)}(hjh]hread()}(hjhhhNhNubah}(h]h ](xrefj#c-funceh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdoc userspace-api/media/rc/lirc-read refdomainj#reftypefunc refexplicitrefwarnjhjk)}jn]jrNasb reftargetreaduh1hhhhK'hjubh attempts to read up to }(hjhhhNhNubj)}(h ``count``h]hcount}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh bytes from file descriptor }(hjhhhNhNubj)}(h``fd``h]hfd}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh into the buffer starting at }(hjhhhNhNubj)}(h``buf``h]hbuf}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh. If }(hjhhhNhNubj)}(h ``count``h]hcount}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh is zero, }(hjhhhNhNubh)}(h:c:func:`read()`h]j)}(hjh]hread()}(hj!hhhNhNubah}(h]h ](jj#c-funceh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainj#reftypefunc refexplicitrefwarnjhjjreaduh1hhhhK'hjubh+ returns zero and has no other results. If }(hjhhhNhNubj)}(h ``count``h]hcount}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh is greater than }(hjhhhNhNubj)}(h ``SSIZE_MAX``h]h SSIZE_MAX}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh, the result is unspecified.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK'hjhhubh)}(hThe exact format of the data depends on what :ref:`lirc_modes` a driver uses. Use :ref:`lirc_get_features` to get the supported mode, and use :ref:`lirc_set_rec_mode` set the current active mode.h](h-The exact format of the data depends on what }(hjjhhhNhNubh)}(h:ref:`lirc_modes`h]hinline)}(hjth]h lirc_modes}(hjxhhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jvhjrubah}(h]h ]h"]h$]h&]refdocj refdomainjreftyperef refexplicitrefwarnj lirc_modesuh1hhhhK,hjjubh a driver uses. Use }(hjjhhhNhNubh)}(h:ref:`lirc_get_features`h]jw)}(hjh]hlirc_get_features}(hjhhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jvhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftyperef refexplicitrefwarnjlirc_get_featuresuh1hhhhK,hjjubh$ to get the supported mode, and use }(hjjhhhNhNubh)}(h:ref:`lirc_set_rec_mode`h]jw)}(hjh]hlirc_set_rec_mode}(hjhhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jvhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftyperef refexplicitrefwarnjlirc_set_rec_modeuh1hhhhK,hjjubh set the current active mode.}(hjjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK,hjhhubh)}(hThe mode :ref:`LIRC_MODE_MODE2 ` is for raw IR, in which packets containing an unsigned int value describing an IR signal are read from the chardev.h](h The mode }(hjhhhNhNubh)}(h(:ref:`LIRC_MODE_MODE2 `h]jw)}(hjh]hLIRC_MODE_MODE2}(hjhhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jvhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftyperef refexplicitrefwarnjlirc-mode-mode2uh1hhhhK0hjubht is for raw IR, in which packets containing an unsigned int value describing an IR signal are read from the chardev.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK0hjhhubh)}(hXAlternatively, :ref:`LIRC_MODE_SCANCODE ` can be available, in this mode scancodes which are either decoded by software decoders, or by hardware decoders. The :c:type:`rc_proto` member is set to the :ref:`IR protocol ` used for transmission, and ``scancode`` to the decoded scancode, and the ``keycode`` set to the keycode or ``KEY_RESERVED``.h](hAlternatively, }(hjhhhNhNubh)}(h.:ref:`LIRC_MODE_SCANCODE `h]jw)}(hj"h]hLIRC_MODE_SCANCODE}(hj$hhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jvhj ubah}(h]h ]h"]h$]h&]refdocj refdomainj.reftyperef refexplicitrefwarnjlirc-mode-scancodeuh1hhhhK4hjubhv can be available, in this mode scancodes which are either decoded by software decoders, or by hardware decoders. The }(hjhhhNhNubh)}(h:c:type:`rc_proto`h]j)}(hjFh]hrc_proto}(hjHhhhNhNubah}(h]h ](jj#c-typeeh"]h$]h&]uh1jhjDubah}(h]h ]h"]h$]h&]refdocj refdomainj#reftypetype refexplicitrefwarnjhjjrc_protouh1hhhhK4hjubh member is set to the }(hjhhhNhNubh)}(h1:ref:`IR protocol `h]jw)}(hjih]h IR protocol}(hjkhhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jvhjgubah}(h]h ]h"]h$]h&]refdocj refdomainjureftyperef refexplicitrefwarnjremote_controllers_protocolsuh1hhhhK4hjubh used for transmission, and }(hjhhhNhNubj)}(h ``scancode``h]hscancode}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh" to the decoded scancode, and the }(hjhhhNhNubj)}(h ``keycode``h]hkeycode}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh set to the keycode or }(hjhhhNhNubj)}(h``KEY_RESERVED``h]h KEY_RESERVED}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK4hjhhubeh}(h] descriptionah ]h"] descriptionah$]h&]uh1hhhhhhhhK%ubh)}(hhh](h)}(h Return Valueh]h Return Value}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKhjhhubeh}(h] return-valueah ]h"] return valueah$]h&]uh1hhhhhhhhKjjjjjju footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}jFKsRparse_messages]transform_messages]hsystem_message)}(hhh]h)}(hhh]h/Hyperlink target "lirc-read" is not referenced.}hjsbah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]levelKtypeINFOsourcehlineKuh1juba transformerN include_log] decorationNhhub.