FreeCalypso > hg > fc-pcsc-tools
annotate misc/fc-pcsc-atr.c @ 150:0d007555ac89
libcommon/file_id.h: add FILEID_ADF
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 25 Feb 2021 16:55:22 +0000 |
parents | 91bcf84a5323 |
children |
rev | line source |
---|---|
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 #include <stdio.h> |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 #include <stdlib.h> |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 #include <pcsclite.h> |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 #include <winscard.h> |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 #include "cardif.h" |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 main(argc, argv) |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 char **argv; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 { |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 int rc; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 |
34
91bcf84a5323
-p reader selection implemented in fc-pcsc-atr
Mychaela Falconia <falcon@freecalypso.org>
parents:
33
diff
changeset
|
12 parse_global_options(argc, argv); |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 setup_pcsc_context(); |
30
84d1c31d0fad
first round of refactoring for selection among multiple readers
Mychaela Falconia <falcon@freecalypso.org>
parents:
26
diff
changeset
|
14 get_reader_list(); |
33
8a4f3d00d997
more refactoring of (select reader by number) logic
Mychaela Falconia <falcon@freecalypso.org>
parents:
30
diff
changeset
|
15 select_reader_by_num(); |
30
84d1c31d0fad
first round of refactoring for selection among multiple readers
Mychaela Falconia <falcon@freecalypso.org>
parents:
26
diff
changeset
|
16 printf("Card reader name: %s\n", selected_reader); |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 connect_to_card(); |
26
4bd6275d7c79
fc-pcsc-atr trivial program added
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
18 rc = retrieve_atr(); |
4bd6275d7c79
fc-pcsc-atr trivial program added
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
19 if (rc) |
4bd6275d7c79
fc-pcsc-atr trivial program added
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
20 error_exit(); |
4bd6275d7c79
fc-pcsc-atr trivial program added
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
21 else |
4bd6275d7c79
fc-pcsc-atr trivial program added
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
22 good_exit(); |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 } |