comparison uicc/main.c @ 22:1b1468869ccf

new trimmed fc-uicc-tool is here
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 12 Feb 2021 04:34:53 +0000
parents
children 78f93e3c9ebf
comparison
equal deleted inserted replaced
21:d4dc86195382 22:1b1468869ccf
1 #include <sys/types.h>
2 #include <stdio.h>
3 #include <stdlib.h>
4 #include <pcsclite.h>
5 #include <winscard.h>
6 #include "cardif.h"
7
8 main(argc, argv)
9 char **argv;
10 {
11 char command[512];
12 int rc;
13
14 setup_pcsc_context();
15 get_reader_name();
16 printf("Card reader name: %s\n", reader_name_buf);
17 connect_to_card();
18 retrieve_atr();
19 if (argc >= 2) {
20 rc = dispatch_ready_argv(argc - 1, argv + 1);
21 if (rc)
22 error_exit();
23 else
24 good_exit();
25 }
26 for (;;) {
27 if (isatty(0)) {
28 fputs("uicc> ", stdout);
29 fflush(stdout);
30 }
31 if (!fgets(command, sizeof command, stdin))
32 good_exit();
33 simtool_dispatch_cmd(command, 0);
34 }
35 }