FreeCalypso > hg > freecalypso-tools
diff rvinterf/lowlevel/rviftmode.c @ 940:ec5f51d33fdc
rvinterf code structure: factor out output_cont_logpref()
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 24 May 2023 06:43:15 +0000 |
parents | 74930218c270 |
children |
line wrap: on
line diff
--- a/rvinterf/lowlevel/rviftmode.c Wed May 24 06:29:13 2023 +0000 +++ b/rvinterf/lowlevel/rviftmode.c Wed May 24 06:43:15 2023 +0000 @@ -17,7 +17,8 @@ extern size_t rxpkt_len; extern int verbose; -extern FILE *logF; + +extern void output_cont_logpref(); static int verify_cksum(pkt, pktlen) @@ -347,16 +348,6 @@ } } -static void -hexdump_out(line) - char *line; -{ - if (logF) - fprintf(logF, "%s\n", line); - else - printf("%s\n", line); -} - void log_sent_tm(pkt, pktlen) u_char *pkt; @@ -367,7 +358,7 @@ sprintf(headline, "Sent Test Mode cmd (%s)", summary); output_line(headline); if (verbose >= 1) - packet_hex_dump(pkt, pktlen, hexdump_out); + packet_hex_dump(pkt, pktlen, output_cont_logpref); } void @@ -379,5 +370,6 @@ sprintf(headline, "Rx Test Mode resp (%s)", summary); output_line(headline); if (verbose >= 1) - packet_hex_dump(rxpkt, (unsigned) rxpkt_len, hexdump_out); + packet_hex_dump(rxpkt, (unsigned) rxpkt_len, + output_cont_logpref); }