Dumps HRPT frames to text file similar to specification document
authorJohnathan Corgan <jcorgan@corganenterprises.com>
Mon, 21 Sep 2009 02:57:30 +0000 (19:57 -0700)
committerJohnathan Corgan <jcorgan@corganenterprises.com>
Mon, 21 Sep 2009 02:57:30 +0000 (19:57 -0700)
gr-noaa/lib/noaa_hrpt_decoder.cc
gr-noaa/lib/noaa_hrpt_deframer.cc

index 7aa815c5c5c2a6c2d120832d59d258c8ec1940b0..4fae0173da945e364e1c60a07e3284361dcbcd90 100644 (file)
@@ -58,6 +58,19 @@ noaa_hrpt_decoder::work(int noutput_items,
   int i = 0;
   while (i < noutput_items) {
     unsigned short word = in[i++];
+    d_word_count++;
+    fprintf(stderr, "%5u:  ", d_word_count);
+    for (int pos = 0; pos < 10; pos++) {
+      char ch = (word & (1 << 9)) ? '1' : '0';
+      word = word << 1;
+      fprintf(stderr, "%c ", ch);
+    }
+    fprintf(stderr, "\n");
+
+    if (d_word_count == 11090) {
+      d_word_count = 0;
+      fprintf(stderr, "\n");
+    }
   }
 
   return i;
index b0de09c91b191583d80d0e5e57fd9fe566e43bb4..77a8e3263ddc19b5e0383770246742a68d5b7662 100644 (file)
@@ -91,7 +91,7 @@ noaa_hrpt_deframer::general_work(int noutput_items,
       d_shifter = (d_shifter << 1) | bit; // MSB transmitted first
       
       if ((d_shifter & 0x0FFFFFFFFFFFFFFF) == HRPT_MINOR_FRAME_SYNC) {
-       fprintf(stderr, "SYNC #%i", frames_seen++);
+       //fprintf(stderr, "SYNC #%i", frames_seen++);
        out[j++] = SYNC1;
        out[j++] = SYNC2;
        out[j++] = SYNC3;
@@ -109,7 +109,7 @@ noaa_hrpt_deframer::general_work(int noutput_items,
        d_word = 0;
        d_bit_count = HRPT_BITS_PER_WORD;
        if (--d_word_count == 0) {
-         fprintf(stderr, "...done\n");
+         //fprintf(stderr, "...done\n");
          enter_idle();
        }
       }