Page
65
of
70
Copyright © Access-IS 2016
C.4 Get ATR of the card
RcvLength = 128;
if
(SCardStatus(hCrd, (LPSTR)_Buffer, &RcvLength, NULL, NULL, ATR, &_ATRLen) !=
SCARD_S_SUCCESS)
{
SCardDisconnect(hCrd, SCARD_LEAVE_CARD);
MessageBox(“Unable to get ATR of card”);
}
else
{
MessageBox(“ATR successful”);
}
C.5 Communicate with card
RcvLength = RX_BUFFER_SIZE;
if
(SCardTransmit(hCrd, &SendPci, TX_Buffer, Transmit_Length, NULL, RX_Buffer, &RcvLength) !=
SCARD_S_SUCCESS)
{
MessageBox(“Communication failed”);
}
else
{
MessageBox(“Communication successful”);
}
C.6 Determine if ATR indicates MIFARE type
Refer to
C.7 Disconnect the card
SCardDisconnect(hCrd, SCARD_LEAVE_CARD);