[Pcsclite-cvs-commit] r2127 - trunk/PCSC/src

Ludovic Rousseau rousseau at costa.debian.org
Tue Aug 8 14:51:44 UTC 2006


Author: rousseau
Date: 2006-08-08 14:51:43 +0000 (Tue, 08 Aug 2006)
New Revision: 2127

Modified:
   trunk/PCSC/src/hotplug_libusb.c
Log:
HPAddHotPluggable(): if a reader fails to start we try to start it a
second time


Modified: trunk/PCSC/src/hotplug_libusb.c
===================================================================
--- trunk/PCSC/src/hotplug_libusb.c	2006-08-07 21:11:47 UTC (rev 2126)
+++ trunk/PCSC/src/hotplug_libusb.c	2006-08-08 14:51:43 UTC (rev 2127)
@@ -454,8 +454,18 @@
 		driver->libraryPath, deviceName) == SCARD_S_SUCCESS)
 		readerTracker[i].status = READER_PRESENT;
 	else
-		readerTracker[i].status = READER_FAILED;
+	{
+		/* remove it */
+		RFRemoveReader(readerTracker[i].fullName, PCSCLITE_HP_BASE_PORT + i);
 
+		/* try a second start */
+		if (RFAddReader(readerTracker[i].fullName, PCSCLITE_HP_BASE_PORT + i,
+			driver->libraryPath, deviceName) == SCARD_S_SUCCESS)
+			readerTracker[i].status = READER_PRESENT;
+		else
+			readerTracker[i].status = READER_FAILED;
+	}
+
 	SYS_MutexUnLock(&usbNotifierMutex);
 
 	return 1;




More information about the Pcsclite-cvs-commit mailing list