view uicc/main.c @ 93:6041c601304d

fcsim1-mkprov: revert OTA key addition It appears that GrcardSIM2 cards (which is what we got for FCSIM1) do not support OTA after all, contrary to what we were previously led to believe by some tech support emails from Grcard - apparently those support emails and OTA descriptions referred to some other card model(s).
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 21 Apr 2021 05:38:39 +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);
	}
}