Search code examples
javascriptusbsmartcard-readerpcsc

CCID slot status byte


Reading the CCID specifications, I was wondering what is the intrinsic structure of the Slot Status (bStatus byte), set in the header of a response (inbound bulk transfer) message.

Only the first two and last two bits are used for bmIccStatus and bmCommandStatus, but I'm not sure how.

Given the (JavaScript) binary notation 0bxx0000yy, is it true that bmCommandStatus is represented by xx?


Solution

  • Given the (JavaScript) binary notation 0bxx0000yy:

    • xx .. bmCommandStatus (mask 0xC0)
    • yy .. bmICCStatus (mask 0x03)

    Reference here (I did check the CCID Rev 1.1, but was unable to find the bit order here -- i.e. MSB first or LSB first).

    You might find using wireshark extremely useful as it supports USB sniffing with CCID support.