Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jul 17th, 2013  |  syntax: C++  |  size: 1.26 KB  |  views: 37  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #ifdef HAVE_CONFIG_H
  2. #include "config.h"
  3. #endif
  4.  
  5. #include <stdio.h>
  6. #include <qitkat_sdc_terminal_sink_b.h>
  7. #include <gr_io_signature.h>
  8.  
  9. qitkat_sdc_terminal_sink_b_sptr qitkat_make_sdc_terminal_sink_b () {
  10.   return gnuradio::get_initial_sptr(new qitkat_sdc_terminal_sink_b ());
  11. }
  12.  
  13. static const int MIN_IN = 1;    // minimum number of input streams
  14. static const int MAX_IN = 1;    // maximum number of input streams
  15. static const int MIN_OUT = 0;   // minimum number of output streams
  16. static const int MAX_OUT = 0;   // maximum number of output streams
  17.  
  18. // private constructor
  19. qitkat_sdc_terminal_sink_b::qitkat_sdc_terminal_sink_b ()
  20.   : gr_block ("sdc_terminal_sink_b",
  21.               gr_make_io_signature (MIN_IN, MAX_IN, sizeof (unsigned char)),
  22.               gr_make_io_signature (MIN_OUT, MAX_OUT, 0))
  23. {
  24. }
  25.  
  26. // private destructor.
  27. qitkat_sdc_terminal_sink_b::~qitkat_sdc_terminal_sink_b ()
  28. {
  29. }
  30.  
  31. int qitkat_sdc_terminal_sink_b::general_work (int noutput_items,
  32.                                gr_vector_int &ninput_items,
  33.                                gr_vector_const_void_star &input_items,
  34.                                gr_vector_void_star &output_items)
  35. {
  36.   // Input items
  37.   const unsigned char *inputByte = (const unsigned char *)input_items[0];
  38.  
  39.   std::cout << (unsigned char)inputByte[0];
  40.  
  41.   consume_each(1);
  42.  
  43.   return 1;
  44. }