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?




--
View this message in context: 
http://musclecard.996296.n3.nabble.com/GP-2-2-INITIALIZE-UPDATE-0x50-oddness-tp5042p5058.html
Sent from the MuscleCard mailing list archive at Nabble.com.

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

Reply via email to