FreeCalypso > hg > freecalypso-tools
diff 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 |
line wrap: on
line diff
--- a/rvinterf/lowlevel/format_fc.c Tue May 23 03:59:42 2023 +0000 +++ b/rvinterf/lowlevel/format_fc.c Tue May 23 05:23:19 2023 +0000 @@ -13,13 +13,15 @@ extern u_char rxpkt[]; extern size_t rxpkt_len; +extern void output_cont(); + static char fmtbuf[MAX_PKT_FROM_TARGET*8]; /* size it generously */ void print_ati_output() { strcpy(fmtbuf, "ATI: "); - safe_print_trace(rxpkt + 1, rxpkt_len - 1, fmtbuf + 5); + safe_print_trace(rxpkt + 1, (int)rxpkt_len - 1, fmtbuf + 5); output_line(fmtbuf); } @@ -27,25 +29,15 @@ print_fc_lld_msg() { strcpy(fmtbuf, "LLD: "); - safe_print_trace(rxpkt + 1, rxpkt_len - 1, fmtbuf + 5); + safe_print_trace(rxpkt + 1, (int)rxpkt_len - 1, fmtbuf + 5); output_line(fmtbuf); } void print_tch_output_raw() { - int i; - char *dp; - - dp = fmtbuf; - strcpy(dp, "TCH:"); - dp += 4; - for (i = 1; i < rxpkt_len; i++) { - sprintf(dp, " %02X", rxpkt[i]); - dp += 3; - } - *dp = '\0'; - output_line(fmtbuf); + output_line("Rx TCH packet"); + packet_hex_dump(rxpkt, (unsigned) rxpkt_len, output_cont); } void