2009/2/2 Ludovic Rousseau <[email protected]>:
> Maybe we could also define a priority rule : if both openct and
> pcsc-lite are installed then pcsc-lite has priority, or something like
> that.
> It can be easy to implement: in the ccid driver just wait for 1 or 2
> seconds before claiming the device. pcsc-lite will then be the first
> to get it.
I propose the attached patch. The idea is to sleep for 3 seconds if a
CCID device is detected and pcsc-lite is also running.
If the device is not claimed by a pcsc-lite driver then openct will
use it as before.
I could not test the patch. I can't make openct 0.6.15 (SVN) work for
me. Maybe I forgot a ./configure option.
Any objection or comment?
Bye
--
Dr. Ludovic Rousseau
[1;32mIndex: src/ifd/ifd-ccid.c[0;0m
[1;32m===================================================================[0;0m
[1;31m--- src/ifd/ifd-ccid.c (révision 1135)[0;0m
[1;34m+++ src/ifd/ifd-ccid.c (copie de travail)[0;0m
[1;35m@@ -15,6 +15,8 @@[0;0m
[0;0m #include "atr.h"[0;0m
[0;0m #include <stdlib.h>[0;0m
[0;0m #include <string.h>[0;0m
[1;34m+#include <sys/stat.h>[0;0m
[1;34m+#include <unistd.h>[0;0m
[0;0m [0;0m
[0;0m #define CCID_ERR_ABORTED 0xFF /* CMD ABORTED */[0;0m
[0;0m #define CCID_ERR_ICC_MUTE 0xFE[0;0m
[1;35m@@ -490,6 +492,13 @@ static int ccid_open_usb(ifd_device_t * [0;0m
[0;0m unsigned char *p;[0;0m
[0;0m int support_events = 0;[0;0m
[0;0m [0;0m
[1;34m+#define PCSCLITE_FILE "/var/run/pcscd/pcscd.comm"[0;0m
[1;34m+ struct stat buf;[0;0m
[1;34m+[0;0m
[1;34m+ /* give priority to pcsc-lite for CCID devices */[0;0m
[1;34m+ if (0 == stat(PCSCLITE_FILE, &buf))[0;0m
[1;34m+ sleep(3);[0;0m
[1;34m+[0;0m
[0;0m if (ifd_usb_get_device(dev, &de)) {[0;0m
[0;0m ct_error("ccid: device descriptor not found");[0;0m
[0;0m ifd_device_close(dev);[0;0m
_______________________________________________
opensc-devel mailing list
[email protected]
http://www.opensc-project.org/mailman/listinfo/opensc-devel