요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. 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.
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.
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.
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 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-45IR 송신에는 driver capability에 따라 pulse/space sequence를 쓰는 `LIRC_MODE_PULSE`와 decode된 값으로 송신하는 `LIRC_MODE_SCANCODE`만 지원됩니다.
Mode 설정 전에 `LIRC_GET_FEATURES`로 driver가 어느 송신 방식을 지원하는지 확인해야 합니다.
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를 구분합니다.
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.
요약·해설
lirc-get-send-mode.rst:1-71송신 mode는 pulse/space 배열과 protocol scan code 두 가지입니다. Driver feature에 맞지 않는 mode는 EINVAL이며 송신 미지원 장치는 ENOTTY입니다.