From 3294e7ce3936f90c1f23197a82deb97cdaed8f6f Mon Sep 17 00:00:00 2001 From: drowe67 Date: Fri, 1 Jan 2016 00:39:29 +0000 Subject: [PATCH] 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 --- codec2-dev/octave/fsk_horus.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 -- 2.25.1