view pcsc/atrmain.c @ 86:de23872796cb

fc-uicc-tool: update-rec-imm and update-rec-fill ported over from fc-simtool
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 11 Apr 2021 03:19:22 +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);
}