← Documents Documentation/userspace-api/media/rc/lirc-get-send-mode.rst GitHub 원문 ↗

Linux 6.18.37 · Userspace API / Media / Remote Controller

LIRC transmit mode 조회와 설정

현재 송신 mode를 PULSE 또는 SCANCODE로 조회·설정합니다.

Source pathDocumentation/userspace-api/media/rc/lirc-get-send-mode.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약·해설

lirc-get-send-mode.rst:1-71

송신 mode는 pulse/space 배열과 protocol scan code 두 가지입니다. Driver feature에 맞지 않는 mode는 EINVAL이며 송신 미지원 장치는 ENOTTY입니다.

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_get_send_mode:
5 .. _lirc_set_send_mode:
6
7 ************************************************
8 ioctls LIRC_GET_SEND_MODE and LIRC_SET_SEND_MODE
9 ************************************************
10
11 Name
12 ====
13
14 LIRC_GET_SEND_MODE/LIRC_SET_SEND_MODE - Get/set current transmit mode.
15
16 Synopsis
17 ========
18
19 .. c:macro:: LIRC_GET_SEND_MODE
20
21 ``int ioctl(int fd, LIRC_GET_SEND_MODE, __u32 *mode)``
22
23 .. c:macro:: LIRC_SET_SEND_MODE
24
25 ``int ioctl(int fd, LIRC_SET_SEND_MODE, __u32 *mode)``
26
27 Arguments
28 =========
29
30 ``fd``
31 File descriptor returned by open().
32
33 ``mode``
34 The mode used for transmitting.
35
36 Description
37 ===========
38
39 Get/set current transmit mode.
40
41 Only :ref:`LIRC_MODE_PULSE <lirc-mode-pulse>` and
42 :ref:`LIRC_MODE_SCANCODE <lirc-mode-scancode>` are supported by for IR send,
43 depending on the driver. Use :ref:`lirc_get_features` to find out which
44 modes the driver supports.
45
46 Return Value
47 ============
48
49 .. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
50
51 .. flat-table::
52 :header-rows: 0
53 :stub-columns: 0
54
55 - .. row 1
56
57 - ``ENODEV``
58
59 - Device not available.
60
61 - .. row 2
62
63 - ``ENOTTY``
64
65 - Device does not support transmitting.
66
67 - .. row 3
68
69 - ``EINVAL``
70
71 - Invalid mode or invalid mode for this device.
72

3. 한국어 전문 번역

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

이름, 선언과 인자

1-35

`LIRC_GET_SEND_MODE`는 현재 송신 mode를 읽고 `LIRC_SET_SEND_MODE`는 송신 mode를 설정합니다. 두 ioctl은 열린 LIRC 장치 `fd`와 `__u32 mode` pointer를 받습니다.

int ioctl(int fd, LIRC_GET_SEND_MODE, __u32 *mode);
int ioctl(int fd, LIRC_SET_SEND_MODE, __u32 *mode);
송신 mode ioctl 인자
인자설명
fd열린 LIRC 장치 file descriptor
mode조회하거나 설정할 transmit mode

Mode pointer는 조회 결과 또는 설정 입력입니다.

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

.. _lirc_get_send_mode:
.. _lirc_set_send_mode:

************************************************
ioctls LIRC_GET_SEND_MODE and LIRC_SET_SEND_MODE
************************************************

Name
====

LIRC_GET_SEND_MODE/LIRC_SET_SEND_MODE - Get/set current transmit mode.

Synopsis
========

.. c:macro:: LIRC_GET_SEND_MODE

``int ioctl(int fd, LIRC_GET_SEND_MODE, __u32 *mode)``

.. c:macro:: LIRC_SET_SEND_MODE

``int ioctl(int fd, LIRC_SET_SEND_MODE, __u32 *mode)``

Arguments
=========

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

``mode``
    The mode used for transmitting.

지원 송신 mode

36-45

IR 송신에는 driver capability에 따라 pulse/space sequence를 쓰는 `LIRC_MODE_PULSE`와 decode된 값으로 송신하는 `LIRC_MODE_SCANCODE`만 지원됩니다.

Mode 설정 전에 `LIRC_GET_FEATURES`로 driver가 어느 송신 방식을 지원하는지 확인해야 합니다.

지원되는 transmit mode
modedata
LIRC_MODE_PULSEMicrosecond pulse/space 배열 송신
LIRC_MODE_SCANCODEProtocol과 scan code를 지정해 송신

Driver가 알린 feature에 따라 선택합니다.

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

Get/set current transmit mode.

Only :ref:`LIRC_MODE_PULSE <lirc-mode-pulse>` and
:ref:`LIRC_MODE_SCANCODE <lirc-mode-scancode>` are supported by for IR send,
depending on the driver. Use :ref:`lirc_get_features` to find out which
modes the driver supports.

오류 코드

46-71

오류는 장치를 사용할 수 없는 경우, 송신 자체를 지원하지 않는 경우, mode 값 또는 device capability가 맞지 않는 경우로 구분됩니다.

송신 mode ioctl 오류
errno조건
ENODEV장치를 사용할 수 없음
ENOTTY장치가 송신을 지원하지 않음
EINVALMode 값이 잘못됐거나 이 장치에서 지원하지 않는 mode

장치 상태와 요청 mode를 구분합니다.

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

.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|

.. flat-table::
    :header-rows:  0
    :stub-columns: 0

    -  .. row 1

       -  ``ENODEV``

       -  Device not available.

    -  .. row 2

       -  ``ENOTTY``

       -  Device does not support transmitting.

    -  .. row 3

       -  ``EINVAL``

       -  Invalid mode or invalid mode for this device.