Skip to content

Commit

Permalink
Update readme with some usage
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Young <[email protected]>
  • Loading branch information
seanyoung committed Apr 28, 2024
1 parent 86e216f commit 941539d
Showing 1 changed file with 84 additions and 2 deletions.
86 changes: 84 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# cir - a new implementation of ir-keytable/ir-ctl for linux
# cir - a new implementation of linux infrared tools

aka as "daemon-less lircd, ir-keytable, ir-ctl combined and much more".

For Linux, there are two tools to interact with any infrared hardware:
ir-ctl and ir-keytable. These tools can load simple infrared keymaps
Expand All @@ -20,6 +22,82 @@ express [any IR protocol](http://hifi-remote.com/wiki/index.php/DecodeIR).
The aim is parse IRP and compile a decoder to BPF. So, any protocol can
be supported directly.

## Listing IR devices

This is the cir equivalent of both `ir-keytable` with no arguments and `ir-ctl -f`.

```
cir config
```

## Transmit/Send

If you have a `.lircd.conf` file or `.toml` keymap, you can send with the following
command:

```
cir transmit keymap foo.lircd.conf KEY_CHANNELUP
```
Alternatively, you can send raw IR directly like so:
```
cir transmit rawir '+9000 -4500 +560'
```
You can also files or linux kernel scancodes, exactly like the `ir-ctl` tool. This supports
mode2 files or raw IR files.
```
cir transmit rawir -s input-file -S nec:0xcafe
```
You can send pronto codes:
```
cir transmit pronto '5000 0073 0000 0001 0001 0001'
```
Lastly you use IRP notation and set the parameters. This is great for experimenting with IRP; use the `--dry-run` (`-n`)
to avoid sending.
```
cir transmit irp -n -fF=2 '{40k,600}<1,-1|2,-1>(4,-1,F:8,^45m)[F:0..255]'
```

## Decoding

Use this if have a `.lircd.conf` file or `.toml` keymap, and want to decode the IR, without changing
any configation.

```
cir decode keymap foo.lircd.conf
```
This will infrared from the first lirc device. You can also decode IR on the command line or a file.

```
cir decode keymap foo.lircd.conf -r '+9000 -4500 +560'
```
or
```
cir decode keymap foo.lircd.conf -f input-file
```

## Configuration

This is the cir equivalent of `ir-keytable -w`.

```
cir config -s rc0 -w foo.lircd.conf
```
This will generate a BPF decoder for `foo.lircd.conf` and load it.

On startup, `ir-keytable -a -s rc0` read the correct keymap from `/etc/rc_maps.cfg`.

```
cir auto -s rc0
```

## Test configuration

This is the cir equivalent of `ir-keytable -t`

```
cir test
```

## Status

All the functionality is in place to load keymaps. More tests are needed,
Expand All @@ -28,4 +106,8 @@ and more polish. The aim is to have this done by the end of 2024.
## Building

On Linux, cir depends on llvm for BPF code generation. On Fedora you
need the `llvm-devel` package install and `llvm-dev` on Ubuntu.
need the `llvm-devel` package install and `llvm-dev` on Ubuntu.

```
cargo install --git https://github.com/seanyoung/cir
```

0 comments on commit 941539d

Please sign in to comment.