pub fn list_devices(&self) -> Result<Vec<FelHandle>, Error> {
        let mut result = Vec::new();
        for device in self
            .context
            .devices()
            .context("unable to list USB devices")?
            .iter()
        {
            let device_descriptor = device
                .device_descriptor()
                .context("unable to get USB device descriptor")?;
            if device_descriptor.vendor_id() == AW_VENDOR_ID
                && device_descriptor.product_id() == AW_PRODUCT_ID
            {
                let usb_handle = UsbHandle::from_device(&device)?;
                let soc_version = usb_handle.get_fel_version()?;
                if let Some(soc_info) = soc::Info::from_version(&soc_version) {
                    result.push(FelHandle {
                        usb_handle,
                        soc_version,
                        soc_info,
                    })
                } else {
                    return Err(FelError::UnsupportedDevId {
                        id: soc_version.get_id(),
                    }
                    .into());
                }
            }
        }
        Ok(result)
    }
/// Creates a list of Allwinner devices in Fel mode.
Creates a list of Allwinner devices in Fel mode.
Creates a list of Allwinner devices in Fel mode .
pub fn list_devices(&self) -> Result<Vec<FelHandle>, Error> {
        let mut result = Vec::new();
        for device in self
            .context
            .devices()
            .context("unable to list USB devices")?
            .iter()
        {
            let device_descriptor = device
                .device_descriptor()
                .context("unable to get USB device descriptor")?;
            if device_descriptor.vendor_id() == AW_VENDOR_ID
                && device_descriptor.product_id() == AW_PRODUCT_ID
            {
                let usb_handle = UsbHandle::from_device(&device)?;
                let soc_version = usb_handle.get_fel_version()?;
                if let Some(soc_info) = soc::Info::from_version(&soc_version) {
                    result.push(FelHandle {
                        usb_handle,
                        soc_version,
                        soc_info,
                    })
                } else {
                    return Err(FelError::UnsupportedDevId {
                        id: soc_version.get_id(),
                    }
                    .into());
                }
            }
        }
        Ok(result)
    }
pub fn list_devices ( & self ) -> Result < Vec < FelHandle > , Error > { let mut result = Vec :: new ( ) ; for device in self . context . devices ( ) . context ( " " ) ? . iter ( ) { let device_descriptor = device . device_descriptor ( ) . context ( " " ) ? ; if device_descriptor . vendor_id ( ) == AW_VENDOR_ID && device_descriptor . product_id ( ) == AW_PRODUCT_ID { let usb_handle = UsbHandle :: from_device ( & device ) ? ; let soc_version = usb_handle . get_fel_version ( ) ? ; if let Some ( soc_info ) = soc :: Info :: from_version ( & soc_version ) { result . push ( FelHandle { usb_handle , soc_version , soc_info , } ) } else { return Err ( FelError :: UnsupportedDevId { id : soc_version . get_id ( ) , } . into ( ) ) ; } } } Ok ( result ) }
Creates a list of Allwinner devices in Fel mode.
Creates a list of Allwinner devices in Fel mode .
&self
&self