SCR331-DI Product Technical Manual
&ActiveProtocol);
/* get actual PUPI status: ON/OFF */
InBufLen
=
2;
InWord
=
CCID_GET_PUPI_STATUS;
ret
=
SCardControl(CardHandle, IOCTL_CCID_ESCAPE,
&InWord,
InBufLen,
&OutByte,
1,
&ResLen);
printf ("\n Get PUPI status: %lx: %.2x", ret,OutByte);
Reader[0].dwCurrentState = SCARD_STATE_UNAWARE;
Reader[0].dwEventState = SCARD_STATE_UNAWARE;
Reader[0].szReader
=
ReaderName[0];
ret
=
SCardGetStatusChange(
ContextHandle, MINTIMEOUT, Reader, 1);
printf
("\nATR:
");
for
(i=0;
i<Reader->cbAtr;
i++)
{
printf
("%.2x
",Reader->rgbAtr[i]);
}
printf
("\n----------------------------------------------\n");
/* set actual PUPI status: OFF */
printf
("\ndisable
PUPI
");
InBufLen
=
2;
InWord
=
CCID_SET_PUPI_OFF;
ret
=
SCardControl(CardHandle, IOCTL_CCID_ESCAPE,
&InWord,
InBufLen,
&OutByte,
1,
&ResLen);
ret
=
SCardDisconnect(CardHandle, SCARD_RESET_CARD);
ret
=
SCardConnect(
ContextHandle,
ReaderName[0],
SCARD_SHARE_SHARED,
SCARD_PROTOCOL_T0 |
SCARD_PROTOCOL_T1,
&CardHandle,
&ActiveProtocol);
/* get actual PUPI status: ON/OFF */
InBufLen
=
2;
InWord
=
CCID_GET_PUPI_STATUS;
ret
=
SCardControl(CardHandle, IOCTL_CCID_ESCAPE,
&InWord,
InBufLen,
&OutByte,
1,
&ResLen);
printf ("\n Get PUPI status: %lx: %.2x", ret,OutByte);
Reader[0].dwCurrentState
=
SCARD_STATE_UNAWARE;
Reader[0].dwEventState = SCARD_STATE_UNAWARE;
Reader[0].szReader
=
ReaderName[0];
ret
=
SCardGetStatusChange(
ContextHandle, MINTIMEOUT, Reader, 1);
printf
("\nATR:
");
for
(i=0;
i<Reader->cbAtr;
i++)
{
printf
("%.2x
",Reader->rgbAtr[i]);
}
printf
("\n----------------------------------------------\n");
IND.SCR331-DI.MANUAL.VER.1.8
VER1.8
Page 35 of 36