pub fn request_event(&self, consumer: &str, gpio: u32, handleflags: RequestFlags, eventflags: EventRequestFlags) -> io::Result<(GpioEventHandle)> {
        let mut request = ioctl::gpioevent_request { lineoffset: 0, handleflags: 0, eventflags: 0, consumer_label: [0; 32], fd: 0 };

        for i in 0..request.consumer_label.len() {
            if i >= consumer.len() {
                break;
            }
            request.consumer_label[i] = consumer.as_bytes()[i] as std::os::raw::c_char;
        }

        request.lineoffset = gpio;
        request.handleflags = handleflags.bits;
        request.eventflags = eventflags.bits;

        try!(from_nix_result(unsafe {
            ioctl::get_lineevent(self.file.as_raw_fd(), &mut request)
        }));

        Ok(GpioEventHandle {file: unsafe {std::fs::File::from_raw_fd(request.fd)}, gpio: gpio, handleflags: handleflags, eventflags: eventflags})
    }
/// Request a `GpioEventHandle` for a single gpio
Request a `GpioEventHandle` for a single gpio
Request a ` GpioEventHandle ` for a single gpio
pub fn request_event(&self, consumer: &str, gpio: u32, handleflags: RequestFlags, eventflags: EventRequestFlags) -> io::Result<(GpioEventHandle)> {
        let mut request = ioctl::gpioevent_request { lineoffset: 0, handleflags: 0, eventflags: 0, consumer_label: [0; 32], fd: 0 };
        for i in 0..request.consumer_label.len() {
            if i >= consumer.len() {
                break;
            }
            request.consumer_label[i] = consumer.as_bytes()[i] as std::os::raw::c_char;
        }
        request.lineoffset = gpio;
        request.handleflags = handleflags.bits;
        request.eventflags = eventflags.bits;
        try!(from_nix_result(unsafe {
            ioctl::get_lineevent(self.file.as_raw_fd(), &mut request)
        }));
        Ok(GpioEventHandle {file: unsafe {std::fs::File::from_raw_fd(request.fd)}, gpio: gpio, handleflags: handleflags, eventflags: eventflags})
    }
pub fn request_event ( & self , consumer : & str , gpio : u32 , handleflags : RequestFlags , eventflags : EventRequestFlags ) -> io :: Result < ( GpioEventHandle ) > { let mut request = ioctl :: gpioevent_request { lineoffset : 0 , handleflags : 0 , eventflags : 0 , consumer_label : [ 0 ; 32 ] , fd : 0 } ; for i in 0 .. request . consumer_label . len ( ) { if i >= consumer . len ( ) { break ; } request . consumer_label [ i ] = consumer . as_bytes ( ) [ i ] as std :: os :: raw :: c_char ; } request . lineoffset = gpio ; request . handleflags = handleflags . bits ; request . eventflags = eventflags . bits ; try ! ( from_nix_result ( unsafe { ioctl get_lineevent ( self file as_raw_fd ( ) mut request ) } ) ) ; Ok ( GpioEventHandle { file : unsafe { std :: fs :: File :: from_raw_fd ( request . fd ) } , gpio : gpio , handleflags : handleflags , eventflags : eventflags } ) }
Request a `GpioEventHandle` for a single gpio
Request a ` GpioEventHandle ` for a single gpio
&self
consumer
&str
gpio
u32
handleflags
RequestFlags
eventflags
EventRequestFlags
&self
consumer
&str
gpio
u32
handleflags
RequestFlags
eventflags
EventRequestFlags