← Documents Documentation/userspace-api/media/rc/lirc-set-rec-timeout.rst GitHub 원문 ↗

Linux 6.18.37 · Userspace API / Media / Remote Controller

LIRC receive timeout 조회와 설정

IR inactivity timeout을 microsecond 단위로 조회·설정합니다.

Source pathDocumentation/userspace-api/media/rc/lirc-set-rec-timeout.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

lirc-set-rec-timeout.rst:1-55

지원 시 0은 hardware timeout 비활성화입니다. 정확한 값이 불가능하면 driver는 요청값보다 큰 다음 지원 값을 선택해야 합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-later
2 .. c:namespace:: RC
3
4 .. _lirc_set_rec_timeout:
5 .. _lirc_get_rec_timeout:
6
7 ***************************************************
8 ioctl LIRC_GET_REC_TIMEOUT and LIRC_SET_REC_TIMEOUT
9 ***************************************************
10
11 Name
12 ====
13
14 LIRC_GET_REC_TIMEOUT/LIRC_SET_REC_TIMEOUT - Get/set the integer value for IR inactivity timeout.
15
16 Synopsis
17 ========
18
19 .. c:macro:: LIRC_GET_REC_TIMEOUT
20
21 ``int ioctl(int fd, LIRC_GET_REC_TIMEOUT, __u32 *timeout)``
22
23 .. c:macro:: LIRC_SET_REC_TIMEOUT
24
25 ``int ioctl(int fd, LIRC_SET_REC_TIMEOUT, __u32 *timeout)``
26
27 Arguments
28 =========
29
30 ``fd``
31 File descriptor returned by open().
32
33 ``timeout``
34 Timeout, in microseconds.
35
36 Description
37 ===========
38
39 Get and set the integer value for IR inactivity timeout.
40
41 If supported by the hardware, setting it to 0 disables all hardware timeouts
42 and data should be reported as soon as possible. If the exact value
43 cannot be set, then the next possible value _greater_ than the
44 given value should be set.
45
46 .. note::
47
48 The range of supported timeout is given by :ref:`LIRC_GET_MIN_TIMEOUT`.
49
50 Return Value
51 ============
52
53 On success 0 is returned, on error -1 and the ``errno`` variable is set
54 appropriately. The generic error codes are described at the
55 :ref:`Generic Error Codes <gen-errors>` chapter.
56

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

이름, 선언과 인자

1-35

`LIRC_GET_REC_TIMEOUT`은 현재 IR inactivity timeout을 읽고 `LIRC_SET_REC_TIMEOUT`은 값을 설정합니다. 단위는 microsecond입니다.

int ioctl(int fd, LIRC_GET_REC_TIMEOUT, __u32 *timeout);
int ioctl(int fd, LIRC_SET_REC_TIMEOUT, __u32 *timeout);
Receive timeout 인자
인자설명
fdopen()이 반환한 LIRC 장치 file descriptor
timeoutIR inactivity timeout(us)

조회와 설정 모두 같은 u32 pointer를 사용합니다.

.. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-later
.. c:namespace:: RC

.. _lirc_set_rec_timeout:
.. _lirc_get_rec_timeout:

***************************************************
ioctl LIRC_GET_REC_TIMEOUT and LIRC_SET_REC_TIMEOUT
***************************************************

Name
====

LIRC_GET_REC_TIMEOUT/LIRC_SET_REC_TIMEOUT - Get/set the integer value for IR inactivity timeout.

Synopsis
========

.. c:macro:: LIRC_GET_REC_TIMEOUT

``int ioctl(int fd, LIRC_GET_REC_TIMEOUT, __u32 *timeout)``

.. c:macro:: LIRC_SET_REC_TIMEOUT

``int ioctl(int fd, LIRC_SET_REC_TIMEOUT, __u32 *timeout)``

Arguments
=========

``fd``
    File descriptor returned by open().

``timeout``
    Timeout, in microseconds.

0의 의미와 값 반올림

36-49

Hardware가 지원하면 timeout을 0으로 설정해 모든 hardware timeout을 끄고 data를 가능한 한 빨리 보고하게 할 수 있습니다.

요청한 값을 정확히 설정할 수 없으면 driver는 요청값보다 큰 값 중 다음으로 가능한 값을 선택해야 합니다. 더 작은 값으로 내리면 application이 기대한 inactivity 기간보다 일찍 frame을 끝낼 수 있기 때문입니다.

지원 범위는 `LIRC_GET_MIN_TIMEOUT`과 `LIRC_GET_MAX_TIMEOUT`으로 확인합니다. 고정 timeout 장치에서는 설정이 불가능할 수 있습니다.

Receive timeout 설정
최소·최대 timeout 조회범위 안의 microsecond 값 선택LIRC_SET_REC_TIMEOUT 호출필요하면 LIRC_GET_REC_TIMEOUT으로 실제 값 확인

지원 범위를 확인하고 driver가 선택한 실제 값을 다시 읽습니다.

Description
===========

Get and set the integer value for IR inactivity timeout.

If supported by the hardware, setting it to 0  disables all hardware timeouts
and data should be reported as soon as possible. If the exact value
cannot be set, then the next possible value _greater_ than the
given value should be set.

.. note::

   The range of supported timeout is given by :ref:`LIRC_GET_MIN_TIMEOUT`.

반환값

50-55

성공하면 0, 오류이면 -1을 반환하고 `errno`를 설정합니다. 공통 오류는 Generic Error Codes 절에 정의됩니다.

Return Value
============

On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.