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
sourceimpl LircMode2
impl LircMode2
sourcepub fn load(&mut self) -> Result<(), ProgramError>
pub fn load(&mut self) -> Result<(), ProgramError>
Loads the program inside the kernel.
See also Program::load
.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for LircMode2
impl !Send for LircMode2
impl !Sync for LircMode2
impl Unpin for LircMode2
impl !UnwindSafe for LircMode2
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more