Send a command ot the PC/SC reader

Role

This method gives access to the SCardControl function.

If the reader is not connected (no token provided), then it will auto-connect to it and once the command is done, it will disconnect automatically.

In case the reader is already connected, it will not disconnect it at the end of the comamnd and the timer will be reseted.

Prototype

Method : pcsc.reader.{$id}.control

where {$id} is the ReaderId, as found from an earlier call to the List PC/SC readers method.

Params :

Field Description
Token Token given when connected to the card (optional)
Command The command to send to the reader (hexadecimal string)

Example

--> { "jsonrpc": "2.0", "id": 1,
		"method": "pcsc.reader.mvQ5w5-6ZUbGfl76Q6w-lw.control",
		"params": {
			"Token": "0AAZZevyX99hu1Py0Suib6",
			"Command": "582001"
		}
    }

Success

Result :

Field Description
Result success if the PC/SC subsystem has returned SCARD_S_SUCCESS
Response The response that has been received from the reader (hexadecimal string)

Example

<-- { "jsonrpc": "2.0", "id": 1,
		"result": {
			"Result": "success",
			"Response": "00537072696E6743617264"
		}
    }

Errors

A result response is returned in case of a PC/SC-error:

<-- { "jsonrpc": "2.0", "id": 1,
		"result": {
			"Result": "error",
			"Error": "SCARD_F_INTERNAL_ERROR",
			"Message": "An internal consistency check failed."
		}			 
    }

The error code 403 is returned in an error response if the specified {$id} is not found:

<-- { "jsonrpc": "2.0", "id": 1,
		"error": {
			"code": 403,
			"message": "Not found"
		}	
    }