From 6ad28759408695a4825738bcc32bc294d1869ca8 Mon Sep 17 00:00:00 2001 From: Josh Allen Date: Sun, 12 Feb 2017 11:09:38 -0500 Subject: handler for bad crc32 --- tools/ootx_decode/ootx_decode.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tools/ootx_decode/ootx_decode.c') diff --git a/tools/ootx_decode/ootx_decode.c b/tools/ootx_decode/ootx_decode.c index 0abde2d..9e76d8f 100644 --- a/tools/ootx_decode/ootx_decode.c +++ b/tools/ootx_decode/ootx_decode.c @@ -44,16 +44,15 @@ void write_to_file(uint8_t *d, uint16_t length){ fclose(fp); } -void bad_crc(ootx_packet* packet) { +void bad_crc(ootx_packet* packet, uint32_t crc) { printf("CRC mismatch\n"); -/* + printf("r:"); - print_crc32(op.crc32); + print_crc32(packet->crc32); printf("c:"); print_crc32(crc); -// write_to_file(op.data,op.length); -*/ + write_to_file(packet->data,packet->length); } ootx_decoder_context ctx[2]; @@ -61,7 +60,6 @@ ootx_decoder_context ctx[2]; void hello_world_test() { // ootx_init_buffer(); ootx_packet_clbk = my_test; - ootx_bad_crc_clbk = bad_crc; char* line = NULL; size_t line_len = 0; @@ -87,6 +85,7 @@ void hello_world_test() { void raw_test() { ootx_packet_clbk = my_test2; + ootx_bad_crc_clbk = bad_crc; char* line = NULL; size_t line_len = 0; @@ -146,6 +145,7 @@ void raw_test() { void acode_test() { ootx_packet_clbk = my_test2; + ootx_bad_crc_clbk = bad_crc; char* line = NULL; size_t line_len = 0; -- cgit v1.2.3