lirc.4: Minor fixes after Sean Young's patches

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2018-11-01 12:57:11 +01:00
parent e5f0504c7a
commit 8e7e9720f6
1 changed files with 35 additions and 19 deletions

View File

@ -27,16 +27,16 @@ lirc \- lirc devices
.SH DESCRIPTION
.PP
The
.B /dev/lirc*
.I /dev/lirc*
character devices provide a low-level
bi-directional interface to infra-red (IR) remotes. Most of these devices
can receive, and some can send.
bidirectional interface to infra-red (IR) remotes.
Most of these devices can receive, and some can send.
When receiving or sending data, the driver works in two different modes
depending on the underlying hardware.
.PP
Some hardware (typically TV-cards) decodes the IR signal internally
and provide decoded button presses as scancode values. Drivers for this
kind of hardware work in
and provide decoded button presses as scancode values.
Drivers for this kind of hardware work in
.BR LIRC_MODE_SCANCODE
mode.
Such hardware usually does not support sending IR signals.
@ -50,11 +50,15 @@ Such drivers work in
mode.
Sometimes, this kind of hardware also supports
sending IR data.
Such hardware can be used with (almost) any kind of remote. This type
of hardware can also be used in
Such hardware can be used with (almost) any kind of remote.
This type of hardware can also be used in
.BR LIRC_MODE_SCANCODE
mode, in which case the kernel IR decoders will decode the IR. These
decoders can be written in bpf(2) and attached to the lirc device.
mode, in which case the kernel IR decoders will decode the IR.
These decoders can be written in
.BR bpf (2)
and attached to the
.B lirc
device.
.PP
The \fBLIRC_GET_FEATURES\fR ioctl (see below) allows probing for whether
receiving and sending is supported, and in which modes, amongst other
@ -90,9 +94,10 @@ ioctl.
In the \fBLIRC_MODE_SCANCODE\fR
mode, the data returned by
.BR read (2)
reflects decoded button presses, in the struct \fBlirc_scancode\fR. The
scancode is stored in the \fBscancode\fR field, and the IR protocol
in \fBrc_proto\fR. This field has on the values of the \fBenum rc_proto\fR.
reflects decoded button presses, in the struct \fIlirc_scancode\fR.
The scancode is stored in the \fIscancode\fR field, and the IR protocol
in \fIrc_proto\fR.
This field has on the values of the \fIenum rc_proto\fR.
.\"
.SS Writing output with the LIRC_MODE_PULSE mode
.PP
@ -114,13 +119,17 @@ call fails with the error
.SS Writing output with the LIRC_MODE_SCANCODE mode
.PP
The data written to the character devices must be a single struct
\fBlirc_scancode\fR. The \fBscancode\fR and \fBrc_proto\fR fields must
filled in, all other fields must be 0. The kernel IR encoders will
\fIlirc_scancode\fR.
The \fIscancode\fR and \fIrc_proto\fR fields must
filled in, all other fields must be 0.
The kernel IR encoders will
convert the scancode to pulses and spaces.
.BR write (2)
call fails with the error
.BR EINVAL
The protocol or scancode is invalid, or the lirc device cannot transmit.
The protocol or scancode is invalid, or the
.B lirc
device cannot transmit.
.SH IOCTL COMMANDS
.PP
The complete list of ioctl commands is maintained in the kernel
@ -139,7 +148,8 @@ these values are capped to their 32-bit sizes.
int ioctl(int fd, int cmd, ...);
.fi
.PP
The following ioctls can be used to probe or change specific lirc
The following ioctls can be used to probe or change specific
.B lirc
hardware settings.
Many require a third argument, usually an
.IR int .
@ -161,11 +171,15 @@ Returns a bit mask of combined features bits; see FEATURES.
.PP
If a device returns an error code for
.BR LIRC_GET_FEATURES ,
it is safe to assume it is not a lirc device.
it is safe to assume it is not a
.B lirc
device.
.\"
.SS Optional Commands
.PP
Some lirc devices support commands listed below.
Some
.B lirc
devices support commands listed below.
Unless otherwise stated, these fail with the error \fBENOTTY\fR if the
operation isn't supported, or with the error \fBEINVAL\fR if the operation
failed, or invalid arguments were provided.
@ -180,7 +194,9 @@ Return the receive mode, which will be one of:
The driver returns a sequence of pulse/space durations.
.TP
.BR LIRC_MODE_SCANCODE
The driver returns struct lirc_scancode values, each of which represents
The driver returns struct
.I lirc_scancode
values, each of which represents
a decoded button press.
.RE
.TP