FreeCalypso > hg > fc-sim-tools
view serial/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 | fbedb67d234f |
children |
line wrap: on
line source
/* * This module implements the main() function for fcsim-serial-be. */ #include <stdio.h> #include <stdlib.h> extern unsigned baud_base, baud_spenh; extern int inverse_coding; main(argc, argv) char **argv; { char inbuf[576]; u_char cmd[260]; 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("A"); set_serial_params(baud_base, inverse_coding); if (baud_spenh) spenh_logic(); putchar('\n'); fflush(stdout); for (; fgets(inbuf, sizeof inbuf, stdin); fflush(stdout)) { rc = parse_hex_input(inbuf, cmd); if (rc < 0) continue; if (rc < 5) { printf("error: command APDU is too short\n"); continue; } apdu_exchange(cmd, rc); } exit(0); }