Dumps HRPT frames to text file similar to specification document
[debian/gnuradio] / gr-noaa / lib / noaa_hrpt_decoder.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;