embassy-usb

Crates

git

Versions

default

Flavors

Skip to main content

CcidCommand

Enum CcidCommand 

Source
pub enum CcidCommand<'a> {
    IccPowerOn {
        slot: u8,
        seq: u8,
        power_select: u8,
    },
    IccPowerOff {
        slot: u8,
        seq: u8,
    },
    GetSlotStatus {
        slot: u8,
        seq: u8,
    },
    XfrBlock {
        slot: u8,
        seq: u8,
        bwi: u8,
        level_parameter: u16,
        apdu: &'a [u8],
    },
    GetParameters {
        slot: u8,
        seq: u8,
    },
    SetParameters {
        slot: u8,
        seq: u8,
        protocol_num: u8,
        data: &'a [u8],
    },
    ResetParameters {
        slot: u8,
        seq: u8,
    },
    Abort {
        slot: u8,
        seq: u8,
    },
    Unknown {
        message_type: u8,
        slot: u8,
        seq: u8,
        payload: &'a [u8],
    },
}
Expand description

A parsed CCID command received from the host over the Bulk OUT endpoint.

Variants§

§

IccPowerOn

PC_to_RDR_IccPowerOn (0x62): Host requests ICC card activation and ATR.

Fields

§slot: u8

Target slot number.

§seq: u8

Sequence number for correlation.

§power_select: u8

Power selection voltage (0 = automatic/reader choice).

§

IccPowerOff

PC_to_RDR_IccPowerOff (0x63): Host requests ICC card deactivation.

Fields

§slot: u8

Target slot number.

§seq: u8

Sequence number for correlation.

§

GetSlotStatus

PC_to_RDR_GetSlotStatus (0x65): Host queries slot status.

Fields

§slot: u8

Target slot number.

§seq: u8

Sequence number for correlation.

§

XfrBlock

PC_to_RDR_XfrBlock (0x6F): Host sends an APDU block to the smart card.

Fields

§slot: u8

Target slot number.

§seq: u8

Sequence number for correlation.

§bwi: u8

Block waiting time integer.

§level_parameter: u16

Level parameter (e.g. expected response length or chaining info).

§apdu: &'a [u8]

APDU payload data.

§

GetParameters

PC_to_RDR_GetParameters (0x6C): Host queries slot parameters.

Fields

§slot: u8

Target slot number.

§seq: u8

Sequence number for correlation.

§

SetParameters

PC_to_RDR_SetParameters (0x61): Host sets slot protocol parameters.

Fields

§slot: u8

Target slot number.

§seq: u8

Sequence number for correlation.

§protocol_num: u8

Protocol number (0 for T=0, 1 for T=1).

§data: &'a [u8]

Parameter bytes.

§

ResetParameters

PC_to_RDR_ResetParameters (0x6D): Host resets slot parameters to defaults.

Fields

§slot: u8

Target slot number.

§seq: u8

Sequence number for correlation.

§

Abort

PC_to_RDR_Abort (0x72): Host requests aborting an ongoing transfer.

Fields

§slot: u8

Target slot number.

§seq: u8

Sequence number for correlation.

§

Unknown

Unknown or unsupported CCID command.

Fields

§message_type: u8

Raw CCID message type byte.

§slot: u8

Slot number from header.

§seq: u8

Sequence number from header.

§payload: &'a [u8]

Raw message payload.

Trait Implementations§

Source§

impl<'a> Clone for CcidCommand<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for CcidCommand<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Eq for CcidCommand<'a>

Source§

impl<'a> Format for CcidCommand<'a>
where &'a [u8]: Format,

Source§

fn format(&self, f: Formatter<'_>)

Writes the defmt representation of self to fmt.
Source§

impl<'a> PartialEq for CcidCommand<'a>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<'a> StructuralPartialEq for CcidCommand<'a>

Auto Trait Implementations§

§

impl<'a> Forget for CcidCommand<'a>

§

impl<'a> Freeze for CcidCommand<'a>

§

impl<'a> Move for CcidCommand<'a>

§

impl<'a> RefUnwindSafe for CcidCommand<'a>

§

impl<'a> Send for CcidCommand<'a>

§

impl<'a> Sync for CcidCommand<'a>

§

impl<'a> Unpin for CcidCommand<'a>

§

impl<'a> UnsafeUnpin for CcidCommand<'a>

§

impl<'a> UnwindSafe for CcidCommand<'a>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.