[Pcsclite-cvs-commit] r2936 - /trunk/Drivers/ccid/src/parse.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Fri May 9 14:24:58 UTC 2008


Author: rousseau
Date: Fri May  9 14:24:58 2008
New Revision: 2936

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=2936
Log:
do not try to parse devices with bInterfaceClass=0xFF by default (use
command line argument -p for proprietary class)

Modified:
    trunk/Drivers/ccid/src/parse.c

Modified: trunk/Drivers/ccid/src/parse.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/Drivers/ccid/src/parse.c?rev=2936&op=diff
==============================================================================
--- trunk/Drivers/ccid/src/parse.c (original)
+++ trunk/Drivers/ccid/src/parse.c Fri May  9 14:24:58 2008
@@ -41,6 +41,7 @@
 #define RED "\33[31m"
 #define BRIGHT_RED "\33[01;31m"
 #define GREEN "\33[32m"
+#define MAGENTA "\33[35m"
 #define NORMAL "\33[0m"
 
 static int ccid_parse_interface_descriptor(usb_dev_handle *handle,
@@ -52,13 +53,17 @@
  *					main
  *
  ****************************************************************************/
-int main(void)
+int main(int argc, char *argv[])
 {
 	static struct usb_bus *busses = NULL;
 	struct usb_bus *bus;
 	struct usb_dev_handle *dev_handle;
 	int nb = 0;
 	char buffer[256];
+	char class_ff = FALSE;
+
+	if ((argc > 1) && (0 == strcmp(argv[1], "-p")))
+		class_ff = TRUE;
 
 	usb_init();
 	usb_find_busses();
@@ -120,6 +125,11 @@
 			{
 				usb_close(dev_handle);
 				fprintf(stderr, RED "  NOT a CCID/ICCD device\n" NORMAL);
+				continue;
+			}
+			if (!class_ff && (0xFF == usb_interface->altsetting->bInterfaceClass))
+			{
+				fprintf(stderr, MAGENTA "  Found a possibly CCID/ICCD device (bInterfaceClass = 0xFF). Use -p\n" NORMAL);
 				continue;
 			}
 			fprintf(stderr, GREEN "  Found a CCID/ICCD device\n" NORMAL);




More information about the Pcsclite-cvs-commit mailing list