embassy-usb

Crates

git

Versions

default

Flavors

Skip to main content

CcidDevice

Struct CcidDevice 

Source
pub struct CcidDevice<'d, D: Driver<'d>> { /* private fields */ }
Expand description

USB CCID reader/writer device class.

Implementations§

Source§

impl<'d, D: Driver<'d>> CcidDevice<'d, D>

Source

pub fn new( builder: &mut Builder<'d, D>, state: &'d mut State<'d>, config: Config<'d>, ) -> Self

Create a new CCID device class instance on the USB device builder.

Source

pub fn split(self) -> (CcidReader<'d, D>, CcidWriter<'d, D>)

Split this device into independent reader and writer handles.

Source

pub async fn wait_connection(&mut self)

Waits for the USB host to enable this interface.

Source

pub async fn read_command<'a>( &mut self, buf: &'a mut [u8], ) -> Result<CcidCommand<'a>, EndpointError>

Read and decode the next CCID command from the host.

Source

pub async fn send_data_block( &mut self, slot: u8, seq: u8, status: u8, error: u8, data: &[u8], ) -> Result<(), EndpointError>

Send an RDR_to_PC_DataBlock message carrying data (such as ATR or APDU response).

Source

pub async fn send_slot_status( &mut self, slot: u8, seq: u8, status: u8, error: u8, clock_status: u8, ) -> Result<(), EndpointError>

Send an RDR_to_PC_SlotStatus message reporting current card presence and clock status.

Source

pub async fn send_parameters( &mut self, slot: u8, seq: u8, status: u8, error: u8, protocol_num: u8, params: &[u8], ) -> Result<(), EndpointError>

Send an RDR_to_PC_Parameters message.

Source

pub async fn notify_slot_change( &mut self, slot: u8, card_present: bool, ) -> Result<(), EndpointError>

Send an RDR_to_PC_NotifySlotChange event message over the Interrupt IN endpoint.

Auto Trait Implementations§

§

impl<'d, D> Forget for CcidDevice<'d, D>

§

impl<'d, D> Freeze for CcidDevice<'d, D>
where CcidReader<'d, D>: Freeze, CcidWriter<'d, D>: Freeze,

§

impl<'d, D> Move for CcidDevice<'d, D>

§

impl<'d, D> RefUnwindSafe for CcidDevice<'d, D>

§

impl<'d, D> Send for CcidDevice<'d, D>
where CcidReader<'d, D>: Send, CcidWriter<'d, D>: Send,

§

impl<'d, D> Sync for CcidDevice<'d, D>
where CcidReader<'d, D>: Sync, CcidWriter<'d, D>: Sync,

§

impl<'d, D> Unpin for CcidDevice<'d, D>
where CcidReader<'d, D>: Unpin, CcidWriter<'d, D>: Unpin,

§

impl<'d, D> UnsafeUnpin for CcidDevice<'d, D>

§

impl<'d, D> UnwindSafe for CcidDevice<'d, D>
where CcidReader<'d, D>: UnwindSafe, CcidWriter<'d, D>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.