It is targeted at active C programmers, and not written with the intention to be understandable by non-programmers. Kernel drivers will not be covered in the present article.
User space drivers are nothing else but normal compiled C functions, running as the invoking user which may or may not be root. Therefore, the decomposition between "program" and driver is a priori not always necessary, but instead serves modularization and structuring. Modern hardware, due to embedded micro processors etc. One such driver consists of a C file, containing a number of function, which are linked into the executing program e.
Traditionally at least for LIRC linking takes place during the build process statically linking. Dynamically loaded drivers was introduced LIRC just recently, replacing the statically linked drivers. It turned out to be necessary to slighty augment the driver API version 1.
The new version will be referred to as "Driver API version 2". In this guide, the word plugin refers to the so-file on disk. Each such file contains one or more driver s visible in the user interface.
An IR signal consists of a sequence of on-times pulses and off-times gaps. We disregard modulation for the time being. A full-fledged IR driver, on reading, can deliver the timing of these period "durations". On sending, it can be fed with a list of durations, and it sends these on- and off-periods as modulated IR signals. Much IR hardware was not designed as general-purpose IR hardware, but to allow e.
This hardware in general decodes the IR signal in its own hardware, and delivers, for recognized signals, an integer code denoting the code received like "play". For signals not following the protocol, no output is generated. The "learns" configuration files from such a device is of very limited value, and not portable to other IR devices, since timing information is missing.
In the configuration file, this can be determined by the lines one 0 0 and one 0 0 , which is clearly not usable without the context, namely the hardware used for capturing.
At the time of writing, there are about 44 plugins and 54 drivers. The actual numbers vary depending on configuration i. The tool lirc-lsplugins can be used to generate overviews of the drivers and their capabilities.
A user space driver is a C file where all the functions are declared static , i. The only thing visible from outside is a particular data structure, containing some data elements, and some pointers to functions, that in these way effectively are made public API.
In this way a certain encapsulation is achieved. The data structure will be described next. The struct driver is the data structure representing the driver for LIRC.
It is defined in driver. These fields will next be described. Note that a driver sometimes "misuses" a field; e. Also note that some function pointer may be NULL, indicating that the driver does not implement the said functionality e. It is defined by define int in lirc. The driver is loaded, used and unloaded by the executing program according to the following:. Function called for initializing the driver and the hardware.
It should return nonzero in the case of success. This function simple opens the device. Function called for suspending the driver. Zero return value indicates failure, all other return values success. Function called for sending an IR code, residing in the second argument.
LIRC is a package that allows you to decode and send infra-red signals of many but not all commonly used remote controls. Recent linux kernels makes it possible to use some IR remote controls as regular input devices. Sometimes this makes LIRC redundant. However, LIRC offers more flexibility and functionality and is still the right tool in a lot of scenarios.
The most important part of LIRC is the lircd daemon which decodes IR signals received by the device drivers and provides the information on a socket.
It also accepts commands for IR signals to be sent if the hardware supports this. The user space applications allows you to control your computer with your remote control. You can send X11 events to applications, start programs and much more on just one button press. Using lirc on Raspberry Pie is quite popular these days. If you can't find your remote control here it does not mean that your remote control is not supported.
It's just that there is no config file for it yet. All remote controls that are supported by learning remote controls i. Besides a remote control you also need a capture device to read the data from the remote. Former versions focussed on home-brew capture hardware connected to the serial or parallel port. Descriptions how to build such hardware can be found here.
Current versions of LIRC also support a broad range of other hardware. As a starter, you can use the kernel built-in support for many USB dongles and similar.
Besides this LIRC supports basically any conceivable way to capture your data including serial devices, parallel ports, sound input etc. You can see the complete list in the left pane. After more than 10 years LIRC has a new maintainer. Jarod Wilson is taking over. Good luck for the next 10 years! A new 0. I have made a 0. This should fix incompatibilities with 2.
0コメント