fixed some bad ascii packets when we have 2nd * in line noise after packet
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Fri, 1 Jan 2016 00:39:29 +0000 (00:39 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Fri, 1 Jan 2016 00:39:29 +0000 (00:39 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@2597 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/octave/fsk_horus.m

index ccffceb4e9275aa61aba811ed4ab3a4600b6caee..bd79d4fe72136fb18399ca40b4696e8d44a60c68 100644 (file)
@@ -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