pub fn observe(&self,
                   t0: Instant,
                   pins: &Vec<&InputPin>,
                   out: &mut Vec<Response>) -> Result<()>
    {
        let gpio = Gpio::new()?;
        let t_end = t0 + self.max_runtime();
        let mut t = Instant::now();

        while t < t_end {
            let poll = gpio.poll_interrupts(
                pins.as_slice(),
                false,
                Some(t_end - t))?;

            if let Some((pin, level)) = poll {
                let response = Response::new(
                    Instant::now(),
                    pin.pin(),
                    match level {
                        Level::High => Signal::Digital(true),
                        Level::Low => Signal::Digital(false),
                    });
                out.push(response);
            }

            t = Instant::now();
        }

        Ok(())
    }
/// Record test inputs (outputs from the device).
///
/// Watches for responses from the device under test for a slightly longer duration than the duration of the test.
/// This is done to catch any straggling responses from the device.
Record test inputs (outputs from the device).
Watches for responses from the device under test for a slightly longer duration than the duration of the test.
This is done to catch any straggling responses from the device.
Record test inputs ( outputs from the device ) . Watches for responses from the device under test for a slightly longer duration than the duration of the test . This is done to catch any straggling responses from the device .
pub fn observe(&self,
                   t0: Instant,
                   pins: &Vec<&InputPin>,
                   out: &mut Vec<Response>) -> Result<()>
    {
        let gpio = Gpio::new()?;
        let t_end = t0 + self.max_runtime();
        let mut t = Instant::now();
        while t < t_end {
            let poll = gpio.poll_interrupts(
                pins.as_slice(),
                false,
                Some(t_end - t))?;
            if let Some((pin, level)) = poll {
                let response = Response::new(
                    Instant::now(),
                    pin.pin(),
                    match level {
                        Level::High => Signal::Digital(true),
                        Level::Low => Signal::Digital(false),
                    });
                out.push(response);
            }
            t = Instant::now();
        }
        Ok(())
    }
pub fn observe ( & self , t0 : Instant , pins : & Vec < & InputPin > , out : & mut Vec < Response > ) -> Result < ( ) > { let gpio = Gpio :: new ( ) ? ; let t_end = t0 + self . max_runtime ( ) ; let mut t = Instant :: now ( ) ; while t < t_end { let poll = gpio . poll_interrupts ( pins . as_slice ( ) , false , Some ( t_end - t ) ) ? ; if let Some ( ( pin , level ) ) = poll { let response = Response :: new ( Instant :: now ( ) , pin . pin ( ) , match level { Level :: High => Signal :: Digital ( true ) , Level :: Low => Signal :: Digital ( false ) , } ) ; out . push ( response ) ; } t = Instant :: now ( ) ; } Ok ( ( ) ) }
Record test inputs (outputs from the device).
Record test inputs ( outputs from the device ) .
&self
t0
Instant
pins
&Vec<&InputPin>
out
&mut Vec<Response>
&self
t0
Instant
pins
&Vec<&InputPin>
out
&mut Vec<Response>