comparison rvinterf/lowlevel/format_fc.c @ 928:65953c172f24

rvinterf/lowlevel: new hex dump format
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 23 May 2023 05:23:19 +0000
parents 4e243402f453
children a38430e03e73
comparison
equal deleted inserted replaced
927:4e243402f453 928:65953c172f24
11 #include "../include/limits.h" 11 #include "../include/limits.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
16 extern void output_cont();
17
16 static char fmtbuf[MAX_PKT_FROM_TARGET*8]; /* size it generously */ 18 static char fmtbuf[MAX_PKT_FROM_TARGET*8]; /* size it generously */
17 19
18 void 20 void
19 print_ati_output() 21 print_ati_output()
20 { 22 {
21 strcpy(fmtbuf, "ATI: "); 23 strcpy(fmtbuf, "ATI: ");
22 safe_print_trace(rxpkt + 1, rxpkt_len - 1, fmtbuf + 5); 24 safe_print_trace(rxpkt + 1, (int)rxpkt_len - 1, fmtbuf + 5);
23 output_line(fmtbuf); 25 output_line(fmtbuf);
24 } 26 }
25 27
26 void 28 void
27 print_fc_lld_msg() 29 print_fc_lld_msg()
28 { 30 {
29 strcpy(fmtbuf, "LLD: "); 31 strcpy(fmtbuf, "LLD: ");
30 safe_print_trace(rxpkt + 1, rxpkt_len - 1, fmtbuf + 5); 32 safe_print_trace(rxpkt + 1, (int)rxpkt_len - 1, fmtbuf + 5);
31 output_line(fmtbuf); 33 output_line(fmtbuf);
32 } 34 }
33 35
34 void 36 void
35 print_tch_output_raw() 37 print_tch_output_raw()
36 { 38 {
37 int i; 39 output_line("Rx TCH packet");
38 char *dp; 40 packet_hex_dump(rxpkt, (unsigned) rxpkt_len, output_cont);
39
40 dp = fmtbuf;
41 strcpy(dp, "TCH:");
42 dp += 4;
43 for (i = 1; i < rxpkt_len; i++) {
44 sprintf(dp, " %02X", rxpkt[i]);
45 dp += 3;
46 }
47 *dp = '\0';
48 output_line(fmtbuf);
49 } 41 }
50 42
51 void 43 void
52 report_extui_packet() 44 report_extui_packet()
53 { 45 {