[Pcsclite-cvs-commit] CVS PCSC/src

CVS User rousseau ludovic.rousseau@free.fr
Tue, 01 Mar 2005 02:27:44 -0700


Update of /cvsroot/pcsclite/PCSC/src
In directory haydn:/tmp/cvs-serv22980

Modified Files:
	readerfactory.c 
Log Message:
RFAddReader(): give some time to EHStatusHandlerThread() to
asynchronously power the card.

The problem was that the reader was initialised but the card in the
reader was not powered up immediately. So if you are fast enough to call
SCardConnect() it would fail with a wrong protocol (since the card ATR
is not yet known).


--- /cvsroot/pcsclite/PCSC/src/readerfactory.c	2005/02/22 14:40:26	1.68
+++ /cvsroot/pcsclite/PCSC/src/readerfactory.c	2005/03/01 09:27:43	1.69
@@ -8,7 +8,7 @@
  *  Damien Sauveron <damien.sauveron@labri.fr>
  *  Ludovic Rousseau <ludovic.rousseau@free.fr>
  *
- * $Id: readerfactory.c,v 1.68 2005/02/22 14:40:26 rousseau Exp $
+ * $Id: readerfactory.c,v 1.69 2005/03/01 09:27:43 rousseau Exp $
  */
 
 #include "config.h"
@@ -434,6 +434,9 @@
 		EHSpawnEventHandler(sReadersContexts[dwContextB]);
 	}
 
+	/* do not return before the card (if any is present) is powered up */
+	SYS_USleep(PCSCLITE_STATUS_POLL_RATE);
+
 	return SCARD_S_SUCCESS;
 }