61 DWORD dwPreferred, UCHAR ucAvailable, UCHAR ucDefault)
69 return SET_PROTOCOL_WRONG_ARGUMENT;
72 if (! (dwPreferred & ucAvailable))
86 Log2(PCSC_LOG_ERROR,
"Protocol T=%d requested but unsupported by the card",
88 return SET_PROTOCOL_WRONG_ARGUMENT;
95 dwPreferred &= ucAvailable;
105 return SET_PROTOCOL_WRONG_ARGUMENT;
108 Log2(PCSC_LOG_INFO,
"Attempting PTS to T=%d",
110 rv =
IFDSetPTS(rContext, ucChosen, 0x00, 0x00, 0x00, 0x00);
119 case IFD_ERROR_NOT_SUPPORTED:
121 if (protocol != dwPreferred)
123 if (protocol & dwPreferred)
126 "Set PTS failed (%ld). Using T=%d", rv,
133 dwPreferred = protocol;
139 Log2(PCSC_LOG_INFO,
"Set PTS failed (%ld)", rv);
140 protocol = SET_PROTOCOL_WRONG_ARGUMENT;
146 Log2(PCSC_LOG_INFO,
"PTS protocol failed (%ld)", rv);
147 protocol = SET_PROTOCOL_PPS_FAILED;
153 Log3(PCSC_LOG_INFO,
"Set PTS failed (%ld). Using T=%d", rv,
158 Log2(PCSC_LOG_INFO,
"Set PTS failed (%ld)", rv);
164 protocol = SET_PROTOCOL_PPS_FAILED;
This keeps track of smart card protocols, timing issues and Answer to Reset ATR handling.
This handles card insertion/removal events, updates ATR, protocol, and status information.
#define IFD_NOT_SUPPORTED
request is not supported
#define IFD_PROTOCOL_NOT_SUPPORTED
requested protocol not supported
#define IFD_SUCCESS
no error
RESPONSECODE IFDSetPTS(READER_CONTEXT *rContext, DWORD dwProtocol, UCHAR ucFlags, UCHAR ucPTS1, UCHAR ucPTS2, UCHAR ucPTS3)
Set the protocol type selection (PTS).
This wraps the dynamic ifdhandler functions.
#define SCARD_PROTOCOL_UNDEFINED
protocol not set
#define SCARD_PROTOCOL_T1
T=1 active protocol.
#define SCARD_PROTOCOL_T0
T=0 active protocol.
DWORD PHSetProtocol(struct ReaderContext *rContext, DWORD dwPreferred, UCHAR ucAvailable, UCHAR ucDefault)
Determine which protocol to use.
This handles protocol defaults, PTS, etc.
This keeps track of a list of currently available reader structures.