Driver Model

  |  +---------------------------------------------------------------+
S |  | 'gpm -t msc -m /var/run/lirc/lircm' or a well configured X    |
O |  | (see section 'Configuring lircmd') for details                |
F |  +--------------+------------------------------------------------+
T |                 |
W |   /var/run/lirc/lircm (named pipe (FIFO) ==> one connection)
A |                 |
R |     +-----------+-----------+   +----------------------------------+
E |     | mouse daemon (lircmd) |   | tools (irexec, irxevent, ...)    |
  |     | configured with       |   | configured with ~/.config/lircrc |
  |     | lircmd.conf           |   |                                  |
  |     +-----------+-----------+   +-----------+----------------------+
  |                 |                           |
  |                 +-------------+-------------+
  |                               |
  |              /var/run/lirc/lircd (socket ==> multiple connections)
  |                               |
S |              +----------------+--------------------------+
O |              | decoder daemon (lircd), irrecord or mode2 |    TCP/IP
F |              | lircd is configured through lircd.conf    +---  port
T | User space   |                                           |     8765
W |              +------------------+------------------------+
A |                                 |            |
R |                                 |            |
E |                                 |            |
  |                                 |   /dev/uinput (Linux input layer)
  |                                 |
  |                                 |
  +---------------------------------+----------------------------------
  | Kernel space                    |              (character device
  |                                 |                  driver ==>
  |                    +------------+----------+    one connection)
  |                    |                       |
  |                /dev/lirc               /dev/ttySx
  |                    |                       |
  |       +------------+-------------+   +-----+---------------+
  |       |  LIRC device driver      |   | Linux serial driver |
  |       | (with ioctl-interface)   |   |                     |
  |       +------------+-------------+   +----------+----------+
  |                    |                            |
--+--------------------+----------------------------+------------------
  |                    |                            |
  |         +----------+------------+               |
  |         |                       |               |
  | +-------+----------------+ +----+-----+ +-------+-----------------+
H | | serial / parallel port | | TV cards | | Irman/RemoteMaster/etc. |
W | +------------------------+ +----------+ +-------------------------+
  |

Formats


Writing LIRC userspace drivers

Since 0.9.0 the lirc kernel drivers have been upstreamed to the kernel. So, while developing kernel drivers might be important from a LIRC perspective, it's no longer part of this project.

Since 0.9.1, lirc user-space drivers (plugins) are loaded dynamically and compiled out-of-tree. Refer to the Driver API, the last chapter.


Writing Applications for LIRC

As LIRC is able to both receive and send IR commands there are two possible types of applications: programs that send IR commands liked irsend or programs that receive commands like irexec.

In both cases, the lirc_client api can be used, supporting both sending and receiving of data. Refer to the API documentation and the lirc_client api.

Another way is to connect directly to lircd's output socket and use the command interface. This is common in older code, often to send data (the ability to send data was added to the API 0.9.2). The lircd socket interface is described in the lircd manpage. Note that the routines in the client API can be used to send and receive arbitrary commands, not just to send IR data.


Note for configuration application developers

If you want to make a configuration application, lirc provides a parseable database of the drivers in the configs/ directory. See configs/README for documentation of the format. The lirc-setup tool has example code for parsing the files in configs/.


Adding new remote controls

New remotes are added to the database according to the lirc-remotes wiki.