dumps rx payload in ascii hex, CRC BAD/OK not appended
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Fri, 1 Jan 2016 01:43:19 +0000 (01:43 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Fri, 1 Jan 2016 01:43:19 +0000 (01:43 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@2598 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/octave/fsk_horus.m
codec2-dev/octave/fsk_horus_stream.m
codec2-dev/src/horus_l2.c

index bd79d4fe72136fb18399ca40b4696e8d44a60c68..4b92a00af6c59fc77497e9d972f61a74421db09d 100644 (file)
@@ -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
 
index 1e651f60ab5e0139a646b5d4347a5ee1631c5ce0..968331acf8236283801930fe8020bab834cdc7de 100755 (executable)
@@ -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
index 12c095326140b781deec394fdcf6671fddc643d7..edaf7bf57da4b0ca69a5d5391c0a4958d365aac9 100644 (file)
@@ -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<nbytes; i++) {
+        fprintf(fh, "%02X", (unsigned int)output_payload[i]);
+    }
+    fclose(fh);
+    #endif
+
     return 0;
 }
 #endif