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>
impl<'d, D: Driver<'d>> CcidDevice<'d, D>
Sourcepub fn new(
builder: &mut Builder<'d, D>,
state: &'d mut State<'d>,
config: Config<'d>,
) -> Self
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.
Sourcepub fn split(self) -> (CcidReader<'d, D>, CcidWriter<'d, D>)
pub fn split(self) -> (CcidReader<'d, D>, CcidWriter<'d, D>)
Split this device into independent reader and writer handles.
Sourcepub async fn wait_connection(&mut self)
pub async fn wait_connection(&mut self)
Waits for the USB host to enable this interface.
Sourcepub async fn read_command<'a>(
&mut self,
buf: &'a mut [u8],
) -> Result<CcidCommand<'a>, EndpointError>
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.
Sourcepub async fn send_data_block(
&mut self,
slot: u8,
seq: u8,
status: u8,
error: u8,
data: &[u8],
) -> Result<(), EndpointError>
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).
Sourcepub async fn send_slot_status(
&mut self,
slot: u8,
seq: u8,
status: u8,
error: u8,
clock_status: u8,
) -> Result<(), EndpointError>
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.
Sourcepub async fn send_parameters(
&mut self,
slot: u8,
seq: u8,
status: u8,
error: u8,
protocol_num: u8,
params: &[u8],
) -> Result<(), EndpointError>
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.
Sourcepub async fn notify_slot_change(
&mut self,
slot: u8,
card_present: bool,
) -> Result<(), EndpointError>
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>
impl<'d, D> Move for CcidDevice<'d, D>
impl<'d, D> RefUnwindSafe for CcidDevice<'d, D>
impl<'d, D> Send for CcidDevice<'d, D>
impl<'d, D> Sync for CcidDevice<'d, D>
impl<'d, D> Unpin for CcidDevice<'d, D>
impl<'d, D> UnsafeUnpin for CcidDevice<'d, D>
impl<'d, D> UnwindSafe for CcidDevice<'d, D>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more