[Pcsclite-git-commit] [CCID] 01/02: Improve support of ElatecTWN4_CCID reader

Ludovic Rousseau rousseau at moszumanska.debian.org
Wed Jul 5 08:41:31 UTC 2017


This is an automated email from the git hooks/post-receive script.

rousseau pushed a commit to branch master
in repository CCID.

commit d5f2f893a0f513cdda0821c6dca7cdc337d54ba8
Author: Ludovic Rousseau <ludovic.rousseau at free.fr>
Date:   Wed Jul 5 10:34:47 2017 +0200

    Improve support of ElatecTWN4_CCID reader
    
    The reader answers after up to 1 second when no card is present in the
    field. So a 100ms timeoutx was too short.
    
    Thanks to Elatec for the patch.
---
 src/ccid.c | 15 ++++++++++-----
 src/ccid.h |  3 ++-
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/src/ccid.c b/src/ccid.c
index 3dc0456..d71ed11 100644
--- a/src/ccid.c
+++ b/src/ccid.c
@@ -87,10 +87,14 @@ int ccid_open_hack_pre(unsigned int reader_index)
 			ccid_descriptor->dwMaxDataRate = 9600;
 			break;
 
-		case ElatecTWN4:
-			/* use a timeout of 400 ms instead of 100 ms in CmdGetSlotStatus()
-			 * used by CreateChannelByNameOrChannel()
-			 * The reader answers after 280 ms if no tag is present */
+		case ElatecTWN4_CCID_CDC:
+		case ElatecTWN4_CCID:
+			/* Use a timeout of 1000 ms instead of 100 ms in
+			 * CmdGetSlotStatus() used by CreateChannelByNameOrChannel()
+			 * The reader answers after up to 1 s if no tag is present */
+			ccid_descriptor->readTimeout = DEFAULT_COM_READ_TIMEOUT * 10;
+			break;
+
 		case SCM_SCL011:
 			/* The SCM SCL011 reader needs 350 ms to answer */
 			ccid_descriptor->readTimeout = DEFAULT_COM_READ_TIMEOUT * 4;
@@ -543,7 +547,8 @@ int ccid_open_hack_post(unsigned int reader_index)
 			}
 			break;
 
-		case ElatecTWN4:
+		case ElatecTWN4_CCID_CDC:
+		case ElatecTWN4_CCID:
 		case SCM_SCL011:
 			/* restore default timeout (modified in ccid_open_hack_pre()) */
 			ccid_descriptor->readTimeout = DEFAULT_COM_READ_TIMEOUT;
diff --git a/src/ccid.h b/src/ccid.h
index b219884..ca0c2a1 100644
--- a/src/ccid.h
+++ b/src/ccid.h
@@ -218,7 +218,8 @@ typedef struct
 #define FEITIANR502DUAL 0x096E060D
 #define MICROCHIP_SEC1100 0x04241104
 #define CHERRY_KC1000SC 0x046A00A1
-#define ElatecTWN4	0x09D80427
+#define ElatecTWN4_CCID_CDC	0x09D80427
+#define ElatecTWN4_CCID	0x09D80428
 #define SCM_SCL011 0x04E65293
 #define HID_AVIATOR	0x076B3A21
 #define HID_OMNIKEY_5422 0x076B5422

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pcsclite/CCID.git



More information about the Pcsclite-cvs-commit mailing list