pub struct LircMode2 { /* private fields */ }
Expand description

A program used to decode IR into key events for a lirc device.

LircMode2 programs can be used to inspect infrared pulses, spaces, and timeouts received by a lirc IR receiver.

Minimum kernel version

The minimum kernel version required to use this feature is 4.18.

Examples

use std::fs::File;
use std::convert::TryInto;
use aya::programs::LircMode2;

let file = File::open("/dev/lirc0")?;
let mut bpf = aya::Bpf::load_file("imon_rsc.o")?;
let decoder: &mut LircMode2 = bpf.program_mut("imon_rsc").unwrap().try_into().unwrap();
decoder.load()?;
decoder.attach(file)?;

Implementations

Loads the program inside the kernel.

Attaches the program to the given lirc device.

The returned value can be used to detach, see LircMode2::detach.

Detaches the program.

See LircMode2::attach.

Takes ownership of the link referenced by the provided link_id.

The link will be detached on Drop and the caller is now responsible for managing its lifetime.

Queries the lirc device for attached programs.

Unloads the program from the kernel.

Links will be detached before unloading the program. Note that owned links obtained using take_link() will not be detached.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the RawFd of the program if it has been loaded, or None

Returns the RawFd of the program if it has been loaded, or None

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.