# HG changeset patch # User Mychaela Falconia # Date 1613717142 0 # Node ID e17940d7ce3585fd5954a6c9f6c32045d7d2b79c # Parent f1836c8d36cb2f34a940183c28715c6f54d66fd5 fc-simtool a38: support output redirection diff -r f1836c8d36cb -r e17940d7ce35 simtool/a38.c --- a/simtool/a38.c Fri Feb 19 06:43:01 2021 +0000 +++ b/simtool/a38.c Fri Feb 19 06:45:42 2021 +0000 @@ -9,8 +9,9 @@ #include #include "simresp.h" -cmd_a38(argc, argv) +cmd_a38(argc, argv, outf) char **argv; + FILE *outf; { u_char cmd[21]; int rc; @@ -50,9 +51,9 @@ sim_resp_data_len); return(-1); } - printf("SRES: %02X %02X %02X %02X\n", sim_resp_data[0], + fprintf(outf, "SRES: %02X %02X %02X %02X\n", sim_resp_data[0], sim_resp_data[1], sim_resp_data[2], sim_resp_data[3]); - printf("Kc: %02X %02X %02X %02X %02X %02X %02X %02X\n", + fprintf(outf, "Kc: %02X %02X %02X %02X %02X %02X %02X %02X\n", sim_resp_data[4], sim_resp_data[5], sim_resp_data[6], sim_resp_data[7], sim_resp_data[8], sim_resp_data[9], sim_resp_data[10], sim_resp_data[11]); diff -r f1836c8d36cb -r e17940d7ce35 simtool/dispatch.c --- a/simtool/dispatch.c Fri Feb 19 06:43:01 2021 +0000 +++ b/simtool/dispatch.c Fri Feb 19 06:45:42 2021 +0000 @@ -92,7 +92,7 @@ int allow_redir; int (*func)(); } cmdtab[] = { - {"a38", 1, 1, 0, cmd_a38}, + {"a38", 1, 1, 1, cmd_a38}, {"atr", 0, 0, 0, retrieve_atr}, {"change-chv1", 2, 2, 0, cmd_change_chv}, {"change-chv2", 2, 2, 0, cmd_change_chv},