diff options
author | Josh Allen <axlecrusher@gmail.com> | 2017-02-12 11:09:38 -0500 |
---|---|---|
committer | Josh Allen <axlecrusher@gmail.com> | 2017-02-12 11:09:38 -0500 |
commit | 6ad28759408695a4825738bcc32bc294d1869ca8 (patch) | |
tree | d3ca23bad81ad136dada426659c9b8c52d0453b0 /tools/ootx_decode/ootx_decode.c | |
parent | ac556ccbb2ecd419773b3ad941f7aea78a191381 (diff) | |
download | libsurvive-6ad28759408695a4825738bcc32bc294d1869ca8.tar.gz libsurvive-6ad28759408695a4825738bcc32bc294d1869ca8.tar.bz2 |
handler for bad crc32
Diffstat (limited to 'tools/ootx_decode/ootx_decode.c')
-rw-r--r-- | tools/ootx_decode/ootx_decode.c | 12 |
1 files changed, 6 insertions, 6 deletions
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; |