view serial/atrmain.c @ 81:8c23d2a9c013

doc/GrcardSIM2-programming: update for fcsim1-program
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 09 Apr 2021 08:35:54 +0000
parents fbedb67d234f
children
line wrap: on
line source

/*
 * This module implements the main() function for fcsim-serial-atr utility.
 */

#include <stdio.h>
#include <stdlib.h>

extern unsigned baud_base;

main(argc, argv)
	char **argv;
{
	int rc;

	if (argc != 3) {
		fprintf(stderr, "usage: %s ttyport baud\n", argv[0]);
		exit(1);
	}
	open_serial_port(argv[1]);
	parse_baud_spenh_arg(argv[2]);
	set_serial_params(baud_base, -1);
	set_serial_nonblock(0);
	serial_card_reset();
	rc = collect_atr();
	if (rc < 0)
		exit(1);
	print_atr("ATR:");
	exit(0);
}