[][src]Trait punt::UsbContext

pub trait UsbContext: UsbContext {
    fn find_targets(&self) -> Result<Vec<Target<Self>>> { ... }
fn pick_target(&self, serial: Option<&str>) -> Result<Target<Self>> { ... } }

Base trait for a USB context.

Provided methods

fn find_targets(&self) -> Result<Vec<Target<Self>>>

Returns information about all connected targets in bootloader mode. USB devices not in bootloader mode cannot be detected, since their protocol for entering bootloader mode is not specified.

It returns Error::IoError on USB errors during device enumeration.

fn pick_target(&self, serial: Option<&str>) -> Result<Target<Self>>

Returns one target if either

  • A serial number is supplied which matches one of the connected targets' serial numbers or
  • Only one target is connected and either no serial number is supplied or the serial number matches.

It can return the following errors:

Just like with find_targets, only targets in bootloader mode are considered.

Loading content...

Implementors

impl UsbContext for Context[src]

Loading content...