From: drowe67 Date: Fri, 1 Jan 2016 01:43:19 +0000 (+0000) Subject: dumps rx payload in ascii hex, CRC BAD/OK not appended X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=c27a89bab91eed54739bd0190651881bc772dc38;p=freetel-svn-tracking.git dumps rx payload in ascii hex, CRC BAD/OK not appended git-svn-id: https://svn.code.sf.net/p/freetel/code@2598 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2-dev/octave/fsk_horus.m b/codec2-dev/octave/fsk_horus.m index bd79d4fe..4b92a00a 100644 --- a/codec2-dev/octave/fsk_horus.m +++ b/codec2-dev/octave/fsk_horus.m @@ -405,11 +405,6 @@ function [str crc_ok] = extract_ascii(states, rx_bits_buf, uw_loc) str = str(1:ptx_crc-2); - if crc_ok - str = sprintf("%s CRC OK", str); - else - str = sprintf("%s CRC BAD", str); - end endfunction @@ -499,6 +494,11 @@ function extract_and_print_rtty_packets(states, rx_bits_log, rx_bits_sd_log) if crc_ok || crc_flipped_ok states.prev_pkt = rx_bits_log(uw_loc+length(states.rtty.uw):uw_loc+states.rtty.max_packet_len); end + if crc_ok + str = sprintf("%s CRC OK", str); + else + str = sprintf("%s CRC BAD", str); + end printf("%s\n", str); end diff --git a/codec2-dev/octave/fsk_horus_stream.m b/codec2-dev/octave/fsk_horus_stream.m index 1e651f60..968331ac 100755 --- a/codec2-dev/octave/fsk_horus_stream.m +++ b/codec2-dev/octave/fsk_horus_stream.m @@ -82,7 +82,12 @@ while c end end - printf("\n %s \n", str); + if crc_ok + strok = sprintf("%s CRC OK", str); + else + strok = sprintf("%s CRC BAD", str); + end + printf("\n %s \n", strok); % throw out used bits in buffer. We're not sure where the next packet starts % so lets remove everything up to just after the UW we just used to force diff --git a/codec2-dev/src/horus_l2.c b/codec2-dev/src/horus_l2.c index 12c09532..edaf7bf5 100644 --- a/codec2-dev/src/horus_l2.c +++ b/codec2-dev/src/horus_l2.c @@ -619,6 +619,18 @@ int main(void) { h.Latitude, h.Longitude, h.Altitude, h.Speed, h.Sats, h.Temp, h.BattVoltage, h.Checksum); + /* Hex ASCII file output */ + + #define WRITE_HEX_FILE /* overwrite tx[] above, that's OK */ + #ifdef WRITE_HEX_FILE + FILE *fh = fopen("../octave/horus_rx_bits_hex.txt","wt"); + assert(fh != NULL); + for(i=0; i