# HG changeset patch # User Mychaela Falconia # Date 1613145192 0 # Node ID 4bd6275d7c79dcce8741e3d610062cdd17de53cc # Parent 9f28700301a6943d5ae76d9b630526e6f84f814d fc-pcsc-atr trivial program added diff -r 9f28700301a6 -r 4bd6275d7c79 .hgignore --- a/.hgignore Fri Feb 12 05:26:33 2021 +0000 +++ b/.hgignore Fri Feb 12 15:53:12 2021 +0000 @@ -2,6 +2,8 @@ \.[oa]$ +^misc/fc-pcsc-atr$ + ^simtool/fc-simtool$ ^uicc/fc-uicc-tool$ diff -r 9f28700301a6 -r 4bd6275d7c79 misc/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/misc/Makefile Fri Feb 12 15:53:12 2021 +0000 @@ -0,0 +1,17 @@ +CC= gcc +CFLAGS= -O2 -I/usr/include/PCSC -I../libcommon +PROGS= fc-pcsc-atr +LIBS= ../libcommon/libcommon.a +INSTBIN=/opt/freecalypso/bin + +all: ${PROGS} + +fc-pcsc-atr: fc-pcsc-atr.o ${LIBS} + ${CC} ${CFLAGS} -o $@ $@.o ${LIBS} -lpcsclite + +install: + mkdir -p ${INSTBIN} + install -c ${PROGS} ${INSTBIN} + +clean: + rm -f ${PROGS} *.o diff -r 9f28700301a6 -r 4bd6275d7c79 misc/fc-pcsc-atr.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/misc/fc-pcsc-atr.c Fri Feb 12 15:53:12 2021 +0000 @@ -0,0 +1,21 @@ +#include +#include +#include +#include +#include "cardif.h" + +main(argc, argv) + char **argv; +{ + int rc; + + setup_pcsc_context(); + get_reader_name(); + printf("Card reader name: %s\n", reader_name_buf); + connect_to_card(); + rc = retrieve_atr(); + if (rc) + error_exit(); + else + good_exit(); +}