56 DWORD dwPreferred, UCHAR ucAvailable, UCHAR ucDefault)
64 return SET_PROTOCOL_WRONG_ARGUMENT;
67 if (! (dwPreferred & ucAvailable))
81 Log2(PCSC_LOG_ERROR,
"Protocol T=%d requested but unsupported by the card",
83 return SET_PROTOCOL_WRONG_ARGUMENT;
90 dwPreferred &= ucAvailable;
100 return SET_PROTOCOL_WRONG_ARGUMENT;
103 Log2(PCSC_LOG_INFO,
"Attempting PTS to T=%d",
105 rv =
IFDSetPTS(rContext, ucChosen, 0x00, 0x00, 0x00, 0x00);
114 case IFD_ERROR_NOT_SUPPORTED:
116 if (protocol != dwPreferred)
118 if (protocol & dwPreferred)
121 "Set PTS failed (%ld). Using T=%d", rv,
128 dwPreferred = protocol;
134 Log2(PCSC_LOG_INFO,
"Set PTS failed (%ld)", rv);
135 protocol = SET_PROTOCOL_WRONG_ARGUMENT;
141 Log2(PCSC_LOG_INFO,
"PTS protocol failed (%ld)", rv);
142 protocol = SET_PROTOCOL_PPS_FAILED;
148 Log3(PCSC_LOG_INFO,
"Set PTS failed (%ld). Using T=%d", rv,
153 Log2(PCSC_LOG_INFO,
"Set PTS failed (%ld)", rv);
159 protocol = SET_PROTOCOL_PPS_FAILED;
#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.
DWORD PHSetProtocol(struct ReaderContext *rContext, DWORD dwPreferred, UCHAR ucAvailable, UCHAR ucDefault)
Determine which protocol to use.
This handles protocol defaults, PTS, etc.
#define SCARD_PROTOCOL_UNDEFINED
protocol not set
#define SCARD_PROTOCOL_T1
T=1 active protocol.
#define SCARD_PROTOCOL_T0
T=0 active protocol.