Hardware Reference
In-Depth Information
Command-Line Options
The
irdecode
utility program has been designed to take some options. These are listed
when
-h
is used:
$ ./irdecode −h
Usage : ./irdecode [−d] [−g] [−n] [−p gpio]
where :
−d dumps event s
−g gnuplot waveforms
−n don't invert GPIO input
−p gpio GPIO pin to use (17)
$
Without any options provided, the utility tries to decode Samsung remote-control
codes (some of the output is suppressed in this mode). The
-p
option can be provided
to cause the command to use a different GPIO port. In Samsung decode mode,
stderr
receives reports of the key codes. Redirect unit 2 to
/dev/null
if you don't want them.
In this example, we capture the
stderr
output to file
codes.out
. The GPIO port is
specified as 17 here, but this is the command's default:
$ ./irdecode −p17 2>codes.out
Monitoring GPIO 17 f or changes :
<POWER>
123
<RETURN>
73
<EXIT>
Exit .
$
While the program runs, it reports recognized key presses to
stdout
. Special keys are
shown in angle brackets, while the numeric digits just print as digits. In this mode, the
program exits if it sees an
<EXIT>
key press on the remote. You can also enter
^C
in the
terminal session to exit the program.
When the program exits, the
codes.out
file is displayed with the
cat
command:
$ cat codes.out
CODE E0E040BF
CODE E0E020DF
CODE E0E0A05F
CODE E0E0609F
CODE E0E0609F
CODE E0E01AE5
CODE E0E030CF
CODE E0E0609F
CODE E0E0B44B
$