2013/9/20 landyman70 <[email protected]>:
> Okay, been doing a bit more investigating.
> When I run my application, I call the methods in the following order:
> SCardEstablishContext
> [loop]
> SCardConnect
> SCardStatus
> SCardTransmit (select Card Manager A0 00 00 00 03 00 00 00)
> SCardTransmit (get response [00 c0 ...])
> SCardDisconnect()
> [end of loop]
> SCardReleaseContext
>
> so in each loop i connect, get the status (for ATR) and send some commands
> then close the card.
>
> However when I do this I the first SCardTransmit returns 6D00.
> if I then run gscriptor, connect and send the same 2 APDUs it works. Once
> this has worked, my app works correctly.
>
> My calls are:
> SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext)
> SCardConnect(hContext, mszReader, SCARD_SHARE_SHARED, SCARD_PROTOCOL_T0 |
> SCARD_PROTOCOL_T1, &hCard, &dwActiveProtocol)
> SCardStatus(hCard, mszReader, dwReaderNameLen, dwState, dwActiveProtocol,
> pATR, dwATRLen)
> SCardTransmit(hCard, pioSendPci, command, sizeof(command), NULL, pRXData,
> &dwRXDataSize)
> SCardDisconnect(hCard, SCARD_LEAVE_CARD)
> SCardReleaseContext(hContext)
>
> Why is my card not responding up properly until I use gscriptor?

Maybe you should reset the card before the loop start to set the card
in a correct state.

Bye

-- 
 Dr. Ludovic Rousseau

_______________________________________________
Muscle mailing list
[email protected]
http://lists.musclecard.com/mailman/listinfo/muscle_lists.musclecard.com

Reply via email to