[Pcsclite-cvs-commit] r1640 - trunk/Drivers/ccid/src

Ludovic Rousseau rousseau at costa.debian.org
Mon Sep 5 14:40:14 UTC 2005


Author: rousseau
Date: 2005-09-05 14:40:13 +0000 (Mon, 05 Sep 2005)
New Revision: 1640

Modified:
   trunk/Drivers/ccid/src/parse.c
Log:
if bNumDataRatesSupported is 0 we get the list size from what
GET DATA RATES command returns

idem for bNumClockSupported


Modified: trunk/Drivers/ccid/src/parse.c
===================================================================
--- trunk/Drivers/ccid/src/parse.c	2005-09-05 13:17:09 UTC (rev 1639)
+++ trunk/Drivers/ccid/src/parse.c	2005-09-05 14:40:13 UTC (rev 1640)
@@ -205,8 +205,8 @@
 
 	printf("  dwDefaultClock: %.3f MHz\n", dw2i(extra, 10)/1000.0);
 	printf("  dwMaximumClock: %.3f MHz\n", dw2i(extra, 14)/1000.0);
-	printf("  bNumClockSupported: %d\n", extra[18]);
-	if (extra[18])
+	printf("  bNumClockSupported: %d %s\n", extra[18],
+		extra[18] ? "" : "(will use whatever is returned)");
 	{
 		unsigned char buffer[256*sizeof(int)];  /* maximum is 256 records */
 		int n;
@@ -232,7 +232,7 @@
 				int i;
 
 				/* we do not get the expected number of data rates */
-				if (n != extra[18]*4)
+				if ((n != extra[18]*4) && extra[18])
 				{
 					printf("   Got %d clock frequencies but was expecting %d\n",
 						n/4, extra[18]);
@@ -248,8 +248,8 @@
 	}
 	printf("  dwDataRate: %d bps\n", dw2i(extra, 19));
 	printf("  dwMaxDataRate: %d bps\n", dw2i(extra, 23));
-	printf("  bNumDataRatesSupported: %d\n", extra[27]);
-	if (extra[27])
+	printf("  bNumDataRatesSupported: %d %s\n", extra[27],
+		extra[27] ? "" : "(will use whatever is returned)");
 	{
 		unsigned char buffer[256*sizeof(int)];  /* maximum is 256 records */
 		int n;
@@ -275,7 +275,7 @@
 				int i;
 
 				/* we do not get the expected number of data rates */
-				if (n != extra[27]*4)
+				if ((n != extra[27]*4) && extra[27])
 				{
 					printf("   Got %d data rates but was expecting %d\n", n/4,
 						extra[27]);




More information about the Pcsclite-cvs-commit mailing list