FreeCalypso > hg > fc-sim-tools
view pcsc/atrmain.c @ 13:7c26eac6ab00
simtool/main.c: fix reader name and ATR display logic
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 14 Mar 2021 07:22:13 +0000 |
parents | 11f4f8a8fa33 |
children |
line wrap: on
line source
#include <stdio.h> #include <stdlib.h> #include <pcsclite.h> #include <winscard.h> extern SCARDCONTEXT hContext; extern SCARDHANDLE hCard; extern char *selected_reader; main(argc, argv) char **argv; { parse_reader_select_opt(argc, argv); setup_pcsc_context(); get_reader_list(); select_reader_by_num(); printf("Card reader name: %s\n", selected_reader); connect_to_card(); retrieve_atr("ATR:"); SCardDisconnect(hCard, SCARD_UNPOWER_CARD); SCardReleaseContext(hContext); exit(0); }