CCID (PC/SC) over Bluetooth

The CCID (PC/SC) over Bluetooth host interface relies on one service with three characteristics exposed by the SpringCore device in its BLE GATT.

Of course, this part of the GATT is available only if the device is configured for PC/SC Operation.

There are two different implementations, depending whether the device is configured for unpaired (not-bonded) connections, or for paired (bonded) connections.

Choosing between both options is made through the configuration register 02C2 BLE options configuration register. Default configuration is un-bonded, for it is easier to implement on the host side and easier to manager for the user.

The CCID over BLE implementation may optionally use secure communication, whatever the connection mode.

Services and list of characteristics

Unpaired connections

This service and the three underlying characteristics are enabled in the GATT when bit 4 in BLE options is set to "No pairing required". The device accepts CCID operation on top of a not-bonded (connected mode) BLE link. This is the default configuration.

UUID Name Access Details
F91C914F-367C-4108-AC3E-3D30CFDD0A1A Free
281EBED4-86C4-4253-84F1-57FB9AB2F72C CCID_PC_To_RDR Write only2 See paragraph CCID_PC_To_RDR below
811DC7A6-A573-4E15-89CC-7EFACAE04E3C CCID_RDR_To_PC Read, indicate1 See paragraph CCID_RDR_To_PC below
EAB75CAB-C7DC-4DB9-874C-4AD8EE0F180F CCID_Status Indicate See paragraph CCID_Status below

Bound service

This service and the three underlying characteristics are enabled in the GATT when bit 4 in BLE options is set to "Force pairing". In this case, the device accepts CCID operation only on too of a bonded BLE link.

UUID Access Details
7F20CDC5-A9FC-4C70-9292-3ACF9DE71F73 Bonding required
CD5BCE75-65FC-4747-AB9A-FF82BFDFA7FB CCID_PC_To_RDR Write only2 See paragraph CCID_PC_To_RDR below
94EDE62E-0808-46F8-91EC-AC0272D67796 CCID_RDR_To_PC Read, indicate1 See paragraph CCID_RDR_To_PC below
DC2AA4CA-76A9-43F9-9FE5-127652837EF5 CCID_Status Indicate See paragraph CCID_Status below

The characteristic CCID_RDR_To_PC is in indicate mode but cannot emit a notification without having a command previously written on the CCID_PC_To_RDR characteristic

2 Due to limitation on Bluetooth Low Energy write long operations (ie: enqueued prepare write), it is mandatory to write a maximum of 512 bytes for each write operation. CCID header is only sent on the 1st write operation.

Details of the characteristics

CCID_Status

The CCID_Status BLE characteristic is the counterpart of the Interrupt_In endpoint in the USB CCID specification (see the USB CCID specification for details), plus it provides an information that is missing from the standard BLE descriptor: the number of PC/SC slots the device is providing.

The CCID_Status BLE characteristic is an array of 2+ bytes, specified as follow:

  • The number of installed slots (1 for a single NFC/RFID HF reader, 2 is there is an added contact slot, etc),
  • The status of each slot: card present / card absent, and the fact that this information has changed,
  • The fact that a response is ready and that the host shall read the CCID_RDR_To_PC characteristic.

Format

Byte Bits Role Values
0 7 Response ready or Low power notification 1: There is a response to read in CCID_RDR_To_PC or the product is going to low power mode1
0: No response (or direct notification used)
6-3 RFU
2-0 Number of slots 000 to 100
1 7-6 Status/notification for slot 3 See Status/notification for slot 0
5-4 Status/notification for slot 2 See Status/notification for slot 0
3-2 Status/notification for slot 1 See Status/notification for slot 0
1-0 Status/notification for slot 0 00 : card absent, no change since last notification
01 : card present, no change since last notification
10 : card removed notification
11 : card inserted notification
2 7-6 Status/notification for slot 7 See Status/notification for slot 0
5-4 Status/notification for slot 6 See Status/notification for slot 0
3-2 Status/notification for slot 5 See Status/notification for slot 0
1-0 Status/notification for slot 4 See Status/notification for slot 0

Only used on specific devices. Normal behavior is to receive an answer by an indication on CCID_RDR_To_PC.

Notes

Byte 2 is not transmitted if the device has less than 4 PC/SC slots.

CCID_PC_To_RDR

The CCID_PC_To_RDR BLE characteristic is the counterpart of the Bulk_Out endpoint in the USB CCID specification (see the USB CCID specification for details).

The CCID_PC_To_RDR BLE characteristic contains a 10-byte CCID header, optionally followed by a payload (up to 64kB, with a maximum of 512 bytes per write operation).

Format of the message (plain communication)

Bytes Content
0-9 Header
10-N Payload
Byte Content
0 Command code, see table in the CCID protocol chapter.
1-4 Length of payload, LSB-first.
5 Slot number
6 Sequence number
7-9 Command parameters

CCID_RDR_To_PC

The CCID_RDR_To_PC BLE characteristic is the counterpart of the Bulk_In endpoint in the USB CCID specification (see the USB CCID specification for details).

The CCID_RDR_To_PC BLE characteristic contains a 10-byte CCID header, optionally followed by a payload (up to 64kB).

Format of the message (plain communication)

Bytes Content
0-9 Header
10-N Payload

Header

Byte Content
0 Response code. See table in the CCID protocol chapter.
1-4 Length of payload, LSB-first.
5 Slot number
6 Sequence number
7 Slot status
8 Slot error
9 RFU