PC/SC Reader State change event

Everytime a PC/SC Reader State changes (card inserted, activated, freed, unpowered, removed…) this event is fired.

Event specification

event : Pcsc.Reader.StateChange

params : a PCSC_READER_STATE object

PCSC_READER_STATE object

Field name Type Status Description
ReaderId string always The unique identifier of the reader. Use this Id in all /pcsc/reader/{$id}/* requests
Name string always The complete name of the reader, as it has been assigned by the PC/SC driver and subsystem
Status string always See Status string table below
ATR string option If there is a card in the reader, the card’s ATR (in hex)
Error boolean always true if the PC/SC subsystem reports the reader as “unavailable” or “ignored”
Present boolean always true if there is a card in the reader
InUse boolean always true if the card has been connected by an application

Note this PCSC_READER_STATE object used in WebSocket events has fewer fields than the PCSC_READER object the returned by the GET /pcsc/reader/{id} route from the REST API, yet the common fields bear the same name and specification.

Status string

The Status string in the PCSC_READER_STATE object is constructed from the state returned by the PC/SC subsystem, as follow:

Status String Equivalent PC/SC flag(s) Meaning
error IGNORE
UNAVAILABLE
The reader shall be ignored
The reader is not available
empty EMPTY No card in the reader
present PRESENT There is a card in the reader
present,mute PRESENT and MUTE There is a card, but it has failed to return an ATR
present,in_use PRESENT and INUSE The card has been connected by an application and could be shared
present,in_use,exclusive PRESENT and INUSE and EXCLUSIVE The card has been connected by an application and can’t be shared

Example

{
	"jsonrpc": "2.0",
	"event": "Pcsc.Reader.StateChange",
	"params":
	{
		"ReaderId": "6aiBfYtd_3vVQMrj-EqhRg",
		"Name": "SpringCard Prox'N'Roll Contactless 0",
		"Status": "present",
		"ATR": "3B8F8001804F0CA0000003060300030000000068",
		"Error": false,
		"Present": true,
		"InUse": false
	}
}