Page 72 of 77 Copyright © Access-IS 2020
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 MIFARE cards on page 37.
C.7 Disconnect the card
SCardDisconnect(hCrd, SCARD_LEAVE_CARD);