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>>,
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>>,
sourcepub fn new(
allocator: &'bus UsbBusAllocator<Bus>,
request_pipe: Requester<I>,
card_issuers_data: Option<&[u8]>
) -> Self
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.
sourcepub fn check_for_app_response(&mut self)
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.
pub fn did_start_processing(&mut self) -> Status
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>>,
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>
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 moresource§fn get_string(&self, index: StringIndex, _lang_id: u16) -> Option<&str>
fn get_string(&self, index: StringIndex, _lang_id: u16) -> Option<&str>
Gets a class-specific string descriptor. Read more
source§fn endpoint_in_complete(&mut self, addr: EndpointAddress)
fn endpoint_in_complete(&mut self, addr: EndpointAddress)
Called when endpoint with address
addr
has completed transmitting data (IN packet). Read moresource§fn endpoint_out(&mut self, addr: EndpointAddress)
fn endpoint_out(&mut self, addr: EndpointAddress)
Called when endpoint with address
addr
has received data (OUT packet). Read moresource§fn control_in(&mut self, transfer: ControlIn<'_, '_, '_, Bus>)
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>)
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>
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 endpoint_setup(&mut self, addr: EndpointAddress)
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