view pcsc/atrmain.c @ 58:871281cb0555

doc/Low-level-commands: apdu-checksw documented
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 23 Mar 2021 00:21:02 +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);
}