[Pcsclite-cvs-commit] r5294 - in /trunk/PCSC/src: PCSC/ifdhandler.h configfile.l

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Mon Oct 11 08:45:15 UTC 2010


Author: rousseau
Date: Mon Oct 11 08:45:14 2010
New Revision: 5294

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=5294
Log:
reader.conf configuration: If you want to use IFDHCreateChannel()
instead of IFDHCreateChannelByName() then do not use any DEVICENAME line
in the configuration file.  IFDHCreateChannel() will then be called with
the CHANNELID parameter.

Closes: [#312749] Should call IFDHCreateChannel for serial driver with
DEVICENAME /dev/null

Modified:
    trunk/PCSC/src/PCSC/ifdhandler.h
    trunk/PCSC/src/configfile.l

Modified: trunk/PCSC/src/PCSC/ifdhandler.h
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/PCSC/ifdhandler.h?rev=5294&op=diff
==============================================================================
--- trunk/PCSC/src/PCSC/ifdhandler.h (original)
+++ trunk/PCSC/src/PCSC/ifdhandler.h Mon Oct 11 08:45:14 2010
@@ -202,18 +202,23 @@
 example the first serial port device is called @c /dev/ttyS0 under Linux
 and @c /dev/cuaa0 under FreeBSD.
 
+If you want to use IFDHCreateChannel() instead of
+IFDHCreateChannelByName() then do not use any DEVICENAME line in the
+configuration file.  IFDHCreateChannel() will then be called with the
+CHANNELID parameter.
+
 @subsection LIBPATH
 The LIBPATH field is the filename of the driver code. The driver is a
 dynamically loaded piece of code (generally a @c drivername.so* file).
 
 @subsection CHANNELID
 The CHANNELID is no more used for recent drivers (IFD handler 3.0) and
-has been superseded by DEVICENAME. If you have an old driver this field
-is used to indicate the port to use. You should read your driver
-documentation to know what information is needed here. It should be the
-serial port number for a serial reader.
-
- at subsection CHANNELID
+has been superseded by DEVICENAME.
+
+If you have an old driver this field is used to indicate the port to
+use. You should read your driver documentation to know what information
+is needed here. It should be the serial port number for a serial reader.
+
 CHANNELID was the numeric version of the port in which the reader will
 be located. This may be done by a symbolic link where @c /dev/pcsc/1 is
 the first device which may be a symbolic link to @c /dev/ttyS0 or

Modified: trunk/PCSC/src/configfile.l
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/configfile.l?rev=5294&op=diff
==============================================================================
--- trunk/PCSC/src/configfile.l (original)
+++ trunk/PCSC/src/configfile.l Mon Oct 11 08:45:14 2010
@@ -68,7 +68,6 @@
 
 int evaluatetoken(char *pcToken)
 {
-
 	int channelId = 0;
 	int p = 0;
 	unsigned int n = 0;
@@ -122,7 +121,7 @@
 				{
 					Log3(PCSC_LOG_CRITICAL, "Error with device %s: %s",
 						pcDevicename, strerror(errno));
-					Log1(PCSC_LOG_CRITICAL, "You should use 'DEVICENAME /dev/null' if your driver does not use this field");
+					Log1(PCSC_LOG_CRITICAL, "You should remove the DEVICENAME line if your driver does not use this field");
 					badError = 1;
 				}
 			}
@@ -181,7 +180,7 @@
 		pcPrevious = NULL;
 	}
 
-	if (pcFriendlyname != NULL && pcDevicename != NULL &&
+	if (pcFriendlyname != NULL &&
 		pcLibpath != NULL && pcChannelid != NULL && badError != 1)
 	{
 		if (0 == reader_list_size)
@@ -199,6 +198,10 @@
 
 		/* end marker */
 		reader_list[reader_list_size-1].pcFriendlyname = NULL;
+
+		/* the DEVICENAME parameter is optional */
+		if (NULL == pcDevicename)
+			pcDevicename = "";
 
 		channelId = strtoul(pcChannelid, 0, 16);
 		reader_list[reader_list_size-2].pcFriendlyname = strdup(pcFriendlyname);




More information about the Pcsclite-cvs-commit mailing list