[Pcsclite-cvs-commit] Drivers/ccid/src commands.c,1.18,1.19

rousseau@haydn.debian.org rousseau@haydn.debian.org


Update of /cvsroot/pcsclite/Drivers/ccid/src
In directory haydn:/tmp/cvs-serv17595

Modified Files:
	commands.c 
Log Message:
CCID_Receive() returns IFD_PARITY_ERROR if the error returned by the
reader is 0xFD (parity error) and IFD_COMMUNICATION_ERROR otherwise (so
that the T=1 TPDU layer can recover the error)


Index: commands.c
===================================================================
RCS file: /cvsroot/pcsclite/Drivers/ccid/src/commands.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- commands.c	30 Jun 2004 13:21:18 -0000	1.18
+++ commands.c	30 Jun 2004 13:23:42 -0000	1.19
@@ -458,7 +458,10 @@
 	{
 		ccid_error(cmd[ERROR_OFFSET], __FILE__, __LINE__, __FUNCTION__);    /* bError */
 		*rx_length = 0; /* nothing received */
-		return IFD_COMMUNICATION_ERROR;
+		if (0xFD == cmd[ERROR_OFFSET]) /* Parity error during exchange */
+			return IFD_PARITY_ERROR;
+		else
+			return IFD_COMMUNICATION_ERROR;
 	}
 
 	if (cmd[STATUS_OFFSET] & CCID_TIME_EXTENSION)