FreeCalypso > hg > fc-sim-tools
view uicc/main.c @ 101:1888d88478c4
fc-simtool write-hplmn-timer new command
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 14 May 2022 22:54:19 +0000 |
parents | f6d5cff989d6 |
children |
line wrap: on
line source
#include <stdio.h> #include <stdlib.h> #include <unistd.h> extern char be_reader_name[]; extern char be_atr_string[]; extern char be_extra_info[]; main(argc, argv) char **argv; { extern int optind; char command[512]; int rc, batch_stdin; parse_global_options(argc, argv); launch_backend(); collect_backend_init_strings(); if (argc > optind) { rc = dispatch_ready_argv(argc - optind, argv + optind); if (rc) exit(1); else good_exit(); } if (be_reader_name[0]) printf("Card reader name: %s\n", be_reader_name); if (be_atr_string[0]) printf("ATR: %s\n", be_atr_string); if (be_extra_info[0]) puts(be_extra_info); batch_stdin = !isatty(0); for (;;) { if (!batch_stdin) { fputs("uicc> ", stdout); fflush(stdout); } if (!fgets(command, sizeof command, stdin)) good_exit(); if (batch_stdin) printf("Stdin command: %s", command); rc = simtool_dispatch_cmd(command, 0); if (batch_stdin && rc) exit(1); } }