Imported Upstream version 3.2.2
[debian/gnuradio] / gnuradio-core / src / lib / general / gr_correlate_access_code_bb.cc
index 18253e968000416d269870d2f659ba525cbc1846..43dae6c1a2dbd37ab5f0bb8ea76ab3fd4f080e87 100644 (file)
@@ -6,7 +6,7 @@
  * 
  * GNU Radio is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
+ * the Free Software Foundation; either version 3, or (at your option)
  * any later version.
  * 
  * GNU Radio is distributed in the hope that it will be useful,
@@ -28,6 +28,8 @@
 #include <gr_io_signature.h>
 #include <stdexcept>
 #include <gr_count_bits.h>
+#include <cstdio>
+
 
 #define VERBOSE 0
 
@@ -88,7 +90,7 @@ gr_correlate_access_code_bb::work (int noutput_items,
 {
   const unsigned char *in = (const unsigned char *) input_items[0];
   unsigned char *out = (unsigned char *) output_items[0];
-  
+
   for (int i = 0; i < noutput_items; i++){
 
     // compute output value
@@ -109,9 +111,12 @@ gr_correlate_access_code_bb::work (int noutput_items,
     // test for access code with up to threshold errors
     new_flag = (nwrong <= d_threshold);
 
-#if 0   
+#if VERBOSE
     if(new_flag) {
-      printf("%llx  ==>  %llx  :  d_flip=%u\n", d_access_code, d_data_reg, d_flip);
+      fprintf(stderr, "access code found: %llx\n", d_access_code);
+    }
+    else {
+      fprintf(stderr, "%llx  ==>  %llx\n", d_access_code, d_data_reg);
     }
 #endif