[Pcsclite-git-commit] [pcsc-tools] 21/32: pcsc_scan: stress card when "-s" is used

Ludovic Rousseau rousseau at moszumanska.debian.org
Thu May 4 15:44:48 UTC 2017


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

rousseau pushed a commit to branch master
in repository pcsc-tools.

commit 8e8d8a5392a98dc8b32946659fb179cb6feb6857
Author: Ludovic Rousseau <ludovic.rousseau at free.fr>
Date:   Sat Apr 8 17:39:09 2017 +0200

    pcsc_scan: stress card when "-s" is used
---
 pcsc_scan.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/pcsc_scan.c b/pcsc_scan.c
index f592778..85b5011 100644
--- a/pcsc_scan.c
+++ b/pcsc_scan.c
@@ -189,12 +189,13 @@ int main(int argc, char *argv[])
 	char atr_command[sizeof(atr)+sizeof(ATR_PARSER)+2+1];
 	int opt;
 	int analyse_atr = TRUE;
+	int stress_card = FALSE;
 	int pnp = TRUE;
 
 	printf("PC/SC device scanner\n");
 	printf("V " PACKAGE_VERSION " (c) 2001-2017, Ludovic Rousseau <ludovic.rousseau at free.fr>\n");
 
-	while ((opt = getopt(argc, argv, "Vhn")) != EOF)
+	while ((opt = getopt(argc, argv, "Vhns")) != EOF)
 	{
 		switch (opt)
 		{
@@ -207,6 +208,10 @@ int main(int argc, char *argv[])
 				return 1;
 				break;
 
+			case 's':
+				stress_card = TRUE;
+				break;
+
 			case 'h':
 			default:
 				usage();
@@ -548,6 +553,12 @@ get_readers:
 						perror(atr_command);
 				}
 			}
+
+			if (rgReaderStates_t[current_reader].dwEventState &
+				SCARD_STATE_PRESENT && stress_card)
+			{
+				stress(hContext, rgReaderStates_t[current_reader].szReader);
+			}
 		} /* for */
 
 		rv = SCardGetStatusChange(hContext, TIMEOUT, rgReaderStates_t,

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



More information about the Pcsclite-cvs-commit mailing list