Struct usbd_ccid::Ccid

source ·
pub struct Ccid<'bus, Bus, I, const N: usize>where
Bus: 'static + UsbBus,
I: 'static + Interchange<REQUEST = Vec<u8, N>, RESPONSE = Vec<u8, N>>,
{ /* private fields */ }

Implementations§

source§

impl<'bus, Bus, I, const N: usize> Ccid<'bus, Bus, I, N>where
Bus: 'static + UsbBus,
I: 'static + Interchange<REQUEST = Vec<u8, N>, RESPONSE = Vec<u8, N>>,

source

pub fn new(
allocator: &'bus UsbBusAllocator<Bus>,
request_pipe: Requester<I>,
card_issuers_data: Option<&[u8]>
) -> Self

Class constructor.

The optional card issuer’s data may be of length at most 13 bytes, and allows personalizing the Answer-to-Reset, for instance by ASCII-encoding vendor or model information.

source

pub fn check_for_app_response(&mut self)

Read response from application (if any) and start writing it to the USB bus. Should be called before managing Bus.

source

pub fn did_start_processing(&mut self) -> Status

source

pub fn send_wait_extension(&mut self) -> Status

Trait Implementations§

source§

impl<'bus, Bus, I, const N: usize> UsbClass<Bus> for Ccid<'bus, Bus, I, N>where
Bus: 'static + UsbBus,
I: 'static + Interchange<REQUEST = Vec<u8, N>, RESPONSE = Vec<u8, N>>,

source§

fn get_configuration_descriptors(
&self,
writer: &mut DescriptorWriter<'_>
) -> Result<(), UsbError>

Called when a GET_DESCRIPTOR request is received for a configuration descriptor. When called, the implementation should write its interface, endpoint and any extra class descriptors into writer. The configuration descriptor itself will be written by UsbDevice and shouldn’t be written by classes. Read more
source§

fn get_string(&self, index: StringIndex, _lang_id: u16) -> Option<&str>

Gets a class-specific string descriptor. Read more
source§

fn poll(&mut self)

Called whenever the UsbDevice is polled.
source§

fn endpoint_in_complete(&mut self, addr: EndpointAddress)

Called when endpoint with address addr has completed transmitting data (IN packet). Read more
source§

fn endpoint_out(&mut self, addr: EndpointAddress)

Called when endpoint with address addr has received data (OUT packet). Read more
source§

fn control_in(&mut self, transfer: ControlIn<'_, '_, '_, Bus>)

Called when a control request is received with direction DeviceToHost. Read more
source§

fn control_out(&mut self, transfer: ControlOut<'_, '_, '_, Bus>)

Called when a control request is received with direction HostToDevice. Read more
source§

fn get_bos_descriptors(
&self,
writer: &mut BosWriter<'_, '_>
) -> Result<(), UsbError>

Called when a GET_DESCRIPTOR request is received for a BOS descriptor. When called, the implementation should write its blobs such as capability descriptors into writer. The BOS descriptor itself will be written by UsbDevice and shouldn’t be written by classes.
source§

fn reset(&mut self)

Called after a USB reset after the bus reset sequence is complete.
source§

fn endpoint_setup(&mut self, addr: EndpointAddress)

Called when endpoint with address addr has received a SETUP packet. Implementing this shouldn’t be necessary in most cases, but is provided for completeness’ sake. Read more

Auto Trait Implementations§

§

impl<'bus, Bus, I, const N: usize> !RefUnwindSafe for Ccid<'bus, Bus, I, N>

§

impl<'bus, Bus, I, const N: usize> Send for Ccid<'bus, Bus, I, N>

§

impl<'bus, Bus, I, const N: usize> !Sync for Ccid<'bus, Bus, I, N>

§

impl<'bus, Bus, I, const N: usize> Unpin for Ccid<'bus, Bus, I, N>

§

impl<'bus, Bus, I, const N: usize> !UnwindSafe for Ccid<'bus, Bus, I, N>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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 Twhere
U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.