FreeCalypso > hg > freecalypso-tools
comparison rvinterf/lowlevel/rviftmode.c @ 934:0d6be90ae74f
rvinterf -v TM: send hex dump only to log file if we have one
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 23 May 2023 06:49:10 +0000 |
parents | bd6dd6120180 |
children | d203a9c7c4e6 |
comparison
equal
deleted
inserted
replaced
933:bd6dd6120180 | 934:0d6be90ae74f |
---|---|
10 #include <string.h> | 10 #include <string.h> |
11 #include <strings.h> | 11 #include <strings.h> |
12 | 12 |
13 extern u_char rxpkt[]; | 13 extern u_char rxpkt[]; |
14 extern size_t rxpkt_len; | 14 extern size_t rxpkt_len; |
15 | |
15 extern int verbose; | 16 extern int verbose; |
17 extern FILE *logF; | |
16 | 18 |
17 extern void output_cont(); | 19 static void |
20 hexdump_out(line) | |
21 char *line; | |
22 { | |
23 if (logF) | |
24 fprintf(logF, "%s\n", line); | |
25 else | |
26 printf("%s\n", line); | |
27 } | |
18 | 28 |
19 void | 29 void |
20 log_sent_tm(pkt, pktlen) | 30 log_sent_tm(pkt, pktlen) |
21 u_char *pkt; | 31 u_char *pkt; |
22 { | 32 { |
23 output_line("Sent Test Mode packet"); | 33 output_line("Sent Test Mode packet"); |
24 if (verbose >= 1) | 34 if (verbose >= 1) |
25 packet_hex_dump(pkt, pktlen, output_cont); | 35 packet_hex_dump(pkt, pktlen, hexdump_out); |
26 } | 36 } |
27 | 37 |
28 void | 38 void |
29 print_tm_output_new() | 39 print_tm_output_new() |
30 { | 40 { |
31 output_line("Rx Test Mode packet"); | 41 output_line("Rx Test Mode packet"); |
32 if (verbose >= 1) | 42 if (verbose >= 1) |
33 packet_hex_dump(rxpkt, (unsigned) rxpkt_len, output_cont); | 43 packet_hex_dump(rxpkt, (unsigned) rxpkt_len, hexdump_out); |
34 } | 44 } |