FreeCalypso > hg > gsm-net-reveng
diff trau-decode/parse-main.c @ 77:729dbac9df82
trau-decode: factor out parse-data.c
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 08 Feb 2025 05:16:35 +0000 |
parents | d4ee42801cdc |
children | 00fd38c7c8fe |
line wrap: on
line diff
--- a/trau-decode/parse-main.c Sat Feb 08 04:57:15 2025 +0000 +++ b/trau-decode/parse-main.c Sat Feb 08 05:16:35 2025 +0000 @@ -66,29 +66,6 @@ } static void -print_data_subframe(nf, bits) - uint8_t *bits; -{ - unsigned nb; - - printf(" Data frame %d:", nf); - for (nb = 0; nb < 9; nb++) { - printf(" %02X", bits_to_num(bits, 8)); - bits += 8; - } - putchar('\n'); -} - -static void -print_data_frame() -{ - print_data_subframe(0, frame_bits + 4 * 8); - print_data_subframe(1, frame_bits + 13 * 8); - print_data_subframe(2, frame_bits + 22 * 8); - print_data_subframe(3, frame_bits + 31 * 8); -} - -static void dump_raw_frame() { uint8_t *sp = frame_bits; @@ -184,18 +161,10 @@ case 0x16: case 0x17: case 0x14: - printf(" C6-C15: %u%u%u%u%u%u%u%u%u%u\n", frame_bits[22], - frame_bits[23], frame_bits[24], frame_bits[25], - frame_bits[26], frame_bits[27], frame_bits[28], - frame_bits[29], frame_bits[30], frame_bits[31]); - print_data_frame(); + print_data_frame(frame_bits); break; case 0x1F: - printf(" C6-C13: %u%u%u%u%u%u%u%u\n", frame_bits[22], - frame_bits[23], frame_bits[24], frame_bits[25], - frame_bits[26], frame_bits[27], frame_bits[28], - frame_bits[29]); - printf(" M1=%u M2=%u\n", frame_bits[30], frame_bits[31]); + print_edata_frame(frame_bits); break; case 0x06: c6_11 = bits_to_num(frame_bits + 22, 6);