From: drowe67 Date: Fri, 1 Jan 2016 00:39:29 +0000 (+0000) Subject: fixed some bad ascii packets when we have 2nd * in line noise after packet X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=3294e7ce3936f90c1f23197a82deb97cdaed8f6f;p=freetel-svn-tracking.git fixed some bad ascii packets when we have 2nd * in line noise after packet git-svn-id: https://svn.code.sf.net/p/freetel/code@2597 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2-dev/octave/fsk_horus.m b/codec2-dev/octave/fsk_horus.m index ccffceb4..bd79d4fe 100644 --- a/codec2-dev/octave/fsk_horus.m +++ b/codec2-dev/octave/fsk_horus.m @@ -365,6 +365,7 @@ function [str crc_ok] = extract_ascii(states, rx_bits_buf, uw_loc) npad = states.npad; str = []; str_dec = []; nstr = 0; ptx_crc = 1; rx_crc = ""; + endpacket = 0; st = uw_loc + length(states.uw); % first bit of first char en = uw_loc + states.max_packet_len - nfield; @@ -385,10 +386,12 @@ function [str crc_ok] = extract_ascii(states, rx_bits_buf, uw_loc) % build up array for CRC16 check - if ch_dec == 42 + if !endpacket && (ch_dec == 42) + endpacket = 1; rx_crc = crc16(str_dec); % found a '*' so that's the end of the string for CRC calculations ptx_crc = nstr+1; % this is where the transmit CRC starts - else + end + if !endpacket str_dec = [str_dec ch_dec]; end end