Commit 8e8d8a53 authored by Ludovic Rousseau's avatar Ludovic Rousseau

pcsc_scan: stress card when "-s" is used

parent de52e744
......@@ -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@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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment