Sophie

Sophie

distrib > Mageia > 7 > armv7hl > by-pkgid > eb6f01499a5d4428f90019094419e1c5 > files > 799

liblirc-devel-0.10.1-7.mga7.armv7hl.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>LIRC - Linux Infrared Remote Control</TITLE>
<LINK REL="stylesheet" TYPE="text/css" HREF="lirc.css">
<LINK REL="shortcut icon" HREF="../images/favicon.ico">
<META NAME="description" CONTENT="LIRC - Linux Infrared Remote Control">
<META NAME="keywords" CONTENT="linux remote control, multimedia">
<META charset="UTF-8">
</HEAD>
<body>
<TABLE CLASS="menu"><TR>
<TD CLASS="menu"><IMG class="menuimg" SRC="../images/diode.gif" ALT="LIRC icon" ALIGN="LEFT"></TD>
<TD><IMG class="menuimg" SRC="../images/lirc.gif" ALT="LIRC logo" ALIGN="RIGHT"></TD>
</TR></TABLE>
<h1>MODE2</h1>
Section: Commands (1)<br>Updated: Last change: Jan 2017 mode2<br><a href="#index">Index</a>
<a href="index.html">Return to Main Contents</a><hr>

<a name="lbAB"> </a>
<h2>NAME</h2>

<p>

<b>mode2</b> - Show kernel output available for LIRC drivers
</p>
<p>
<a name="lbAC"> </a>
</p>
<h2>SYNOPSIS</h2>

<p>

<b>mode2</b> --driver &lt;<i>driver</i>&gt; [--device &lt;<i>device</i>&gt;]
[<i>other options</i>]
</p>
<p>

<b>mode2</b> --raw --device &lt;<i>device</i>&gt; [<i>other options</i>]
</p>
<p>

<b>mode2</b> --driver &lt;<i>driver</i>&gt;  --list-devices
</p>
<p>
<a name="lbAD"> </a>
</p>
<h2>DESCRIPTION</h2>

<p>

The original purpose of this program has been to check operation of
home-brew LIRC receiver hardware and to see the IR waveform of the
remote controller without an expensive oscilloscope.
Over time, <b>mode2</b> has evolved to a generic tool to check what
kind of output the kernel makes available for lirc.
</p>
<p>

mode2 will simply print pulse and space lengths to stdout for drivers
supporting LIRC_MODE_MODE2. For drivers supporting LIRC_MODE_LIRCCODE such
as TV-cards and the irman driver writes the decoded, integer values.
</p>
<p>

From version 0.9.4, <b>mode2</b> can also list the devices available for a
given driver. This requires enumeration support which is available
in most but not all drivers.
</p>
<p>

When given the correct driver mode2 should always work. Without a driver,
the --raw option should always work for /dev/lirc* devices. At the time
of writing, usb devices also works in most cases. However, since it is
tricky to get the path to the usb device, such ones are normally best
accessed using a driver.
</p>
<p>

Not all drivers requires a device.
</p>
<p>

</p>
<p>
<a name="lbAE"> </a>
</p>
<h2>OPTIONS</h2>

<p>
</p>
<dl>
<div><dt>
<b>-d</b> <b>--device</b>=<i>device</i>
</dt></div>
<dd>
Read from given device.
</dd>
<div><dt>
<b>-H</b> <b>--driver</b>=<i>driver</i>
</dt></div>
<dd>
Use given driver.
</dd>
<div><dt>
<b>-m</b> <b>--mode</b>
</dt></div>
<dd>
Write pulse/space data as raw config files. Does not affect
LIRCCODE drivers.
</dd>
<div><dt>
<b>-s</b> <b>--scope</b>=<i>time</i>
</dt></div>
<dd>
Enable 'scope like display with time us per char. Does not
affect lirccode drivers.
</dd>
<div><dt>
<b>-k</b> <b>--keep-root</b>
</dt></div>
<dd>
Don't drop root privileges after opening device. See RUNNING AS ROOT.
</dd>
<div><dt>
<b>-l</b> <b>--list-devices</b>
</dt></div>
<dd>
List all available devices for given driver. Requires support not
present in all drivers.
</dd>
<div><dt>
<b>-g</b> <b>--gap</b>=<i>time</i>
</dt></div>
<dd>
Treat spaces longer than time as the gap. Time is in microseconds.
</dd>
<div><dt>
<b>-r</b> <b>--raw</b>
</dt></div>
<dd>
Access device directly. This is primarely intended to be used with kernel rc
drivers i .e., when accessing <i>/dev/lirc*</i> devices. Using other devices
might work, but is in general undefined.
</dd>
<div><dt>
<b>-A</b> <b>--driver-options</b>=<i>key:value[|key:value...]</i>
</dt></div>
<dd>
Set driver-specific option named key to given value.
</dd>
<div><dt>
<b>-U</b> <b>--plugindir</b>=<i>directory</i>
</dt></div>
<dd>
Load drivers from directory. See DRIVER LOADING.
</dd>
<div><dt>
<b>-O, --options-file</b> &lt;<i>path</i>&gt;</dt></div>
<dd>
File containing default values for all options. A relative path is
interpreted from current directory. See [FILES] below.
</dd>
<div><dt>
<b>-D</b> <b>--loglevel</b>=<i>level</i>
</dt></div>
<dd>
Determine the amount of logging information. [level] can be a symbolic
syslog level: 'error','warning, 'info', 'notice' or  'debug'. lirc
also defines three additional levels 'trace', 'trace1' and 'trace2' which
gives even more messages ('trace2' bringing the most). However, in the
log these messages are marked as 'debug'.
The level can also be an integer in the range 3 (almost no messages) to
10.
</dd>
<div><dt>
<b>-h</b> <b>--help</b>
</dt></div>
<dd>
Display usage summary.
</dd>
<div><dt>
<b>-v</b> <b>--version</b>
</dt></div>
<dd>
Display version.
<p>
</p>
</dd>
</dl>
<a name="lbAF"> </a>
<h2>RUNNING AS ROOT</h2>

In many cases mode2 needs to run as root to access devices not available
to regular users. On the other hand, running as root creates problems
such as log files owned by root, security concerns etc.
<p>

In order to cope with this, mode2 by default drops root privileges
after opening the input device. This support is based on that root
permissions are accquired using <a href="sudo.html">sudo</a>(1) e. g., using
</p>
<pre>

        $ sudo mode2 --raw /dev/lirc0

</pre>

If not using sudo, the same behaviour could be accomplished using the
SUDO_USER environment variable e. g.,
<pre>

        # SUDO_USER=$LOGNAME mode2 --raw /dev/lirc0

</pre>

The --keep-root option will make mode2 to keep root privileges for the
complete run.
<p>
<a name="lbAG"> </a>
</p>
<h2>EXAMPLES</h2>

<p>
Invoked with a MODE2 type driver with <b>mode2</b> prints space/mark timings:
</p>
<pre>
     <a href="mailto:al@snorken">al@snorken</a> $ ./mode2 --driver default --device /dev/lirc0
     Using driver default on device /dev/lirc0
     Trying device: /dev/lirc0
     Using device: /dev/lirc0
     pulse 2750
     space 800
     pulse 500
     space 350
     pulse 550
     space 350
     pulse 550
     ...
Invoked with a LIRCCODE type driver <b>mode2</b> prints decoded values:

     $ ./mode2 --driver atilibusb
     Using driver atilibusb on device /dev/lirc0
     Trying device: /dev/bus/usb/001/007
     Using device: /dev/bus/usb/001/007
     code: 0x14709b0000
     code: 0x14709b0000
     code: 0x14709b0000
     code: 0x14709b0000
     code: 0x14709b0000
     ...
Invoked using <b>mode2 --list-devices</b> for the devinput driver with a
single X10 RF usb device plugged in:
    $ ./mode2 --list-devices --driver devinput
    /dev/input/event12 [0bc7:0006] X10 WTI RF receiver vers:  1.10 serial: ?
    /dev/input/by-id/usb-X10_WTI_RF_receiver-event-if00 -&gt; ../event12
    /dev/input/by-path/pci-0000:0b:00.0-usb-0:1:1.0-event -&gt; ../event12
</pre>
<a name="lbAH"> </a>
<h2>DRIVER LOADING</h2>

Drivers are loaded dynamically. The search path used for this is determined
by (falling priority):
<dl>
<div><dt>-</dt></div>
<dd>
The --plugindir option.
</dd>
<div><dt>-</dt></div>
<dd>
The 'plugindir' entry in  the [lircd] section of the lirc_options.conf file.
</dd>
<div><dt>-</dt></div>
<dd>
The environment variable LIRC_PLUGINDIR.
</dd>
<div><dt>-</dt></div>
<dd>
A hardcoded default (/usr/lib/lirc/plugins).
<p>
</p>
</dd>
</dl>
<a name="lbAI"> </a>
<h2>ENVIRONMENT</h2>

<dl>
<div><dt>
<b>LIRC_LOGLEVEL</b>

</dt></div>
<dd>
Used as fallback when there is no --loglevel option present. Syntax
is the same as for --loglevel, see OPTIONS.
<p>
</p>
</dd>
</dl>
<a name="lbAJ"> </a>
<h2>FILES</h2>

<dl>
<div><dt>
<b>/etc/lirc/lirc_options.conf</b>

</dt></div>
<dd>
The options file holding default values for command line options in
the [mode2] section. For some values including debug, plugindir, driver
and device mode2 falls back to the [lircd] section if not found in [mode2].
</dd>
<div><dt></dt></div>
<dd>
The location of this file can be changed using the -O/--options-file
command-line option or using the environment variable LIRC_OPTIONS_PATH.
<p>
</p>
</dd>
<div><dt>
<b>~/.cache/mode2.log</b>

</dt></div>
<dd>
Debug log. Setting the XDG_CACHE_HOME environment variable relocates this
file to $XDG_CACHE_HOME/mode2.log. The amount of logging respects the
LIRC_LOGLEVEL environment variable, defaulting to the debug value
in lirc_options.conf.
<p>
</p>
<p>
</p>
</dd>
</dl>
<a name="lbAK"> </a>
<h2>SEE ALSO</h2>

<a href="xmode2.html">xmode2</a>(1)
<br>

<a href="lirc.html">lirc</a>(4)
<p>
The documentation for
<b>lirc</b>

is maintained as html pages. They are located under html/ in the
documentation directory.
</p>
<p>

</p>
<hr>
<a name="index"> </a><h2>Index</h2>
<dl>
<div><dt><a href="#lbAB">NAME</a></dt></div>
<dd>
</dd>
<div><dt><a href="#lbAC">SYNOPSIS</a></dt></div>
<dd>
</dd>
<div><dt><a href="#lbAD">DESCRIPTION</a></dt></div>
<dd>
</dd>
<div><dt><a href="#lbAE">OPTIONS</a></dt></div>
<dd>
</dd>
<div><dt><a href="#lbAF">RUNNING AS ROOT</a></dt></div>
<dd>
</dd>
<div><dt><a href="#lbAG">EXAMPLES</a></dt></div>
<dd>
</dd>
<div><dt><a href="#lbAH">DRIVER LOADING</a></dt></div>
<dd>
</dd>
<div><dt><a href="#lbAI">ENVIRONMENT</a></dt></div>
<dd>
</dd>
<div><dt><a href="#lbAJ">FILES</a></dt></div>
<dd>
</dd>
<div><dt><a href="#lbAK">SEE ALSO</a></dt></div>
<dd>
</dd>
</dl>
<hr>
                        <p>
This document was created by
<a href="index.html">man2html</a>,
using the manual pages.<br>
Time: 12:55:09 GMT, February 16, 2019
                        </p>
<p class="footer">
        [<A HREF="http://www.lirc.org/">LIRC homepage</A>]
      </p>
</body>
</html>