GNU Radio 3.4.2 C++ API
usrp_sink_s.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2004 Free Software Foundation, Inc.
00004  * 
00005  * This file is part of GNU Radio
00006  * 
00007  * GNU Radio is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 3, or (at your option)
00010  * any later version.
00011  * 
00012  * GNU Radio is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  * 
00017  * You should have received a copy of the GNU General Public License
00018  * along with GNU Radio; see the file COPYING.  If not, write to
00019  * the Free Software Foundation, Inc., 51 Franklin Street,
00020  * Boston, MA 02110-1301, USA.
00021  */
00022 
00023 #ifndef INCLUDED_USRP_SINK_S_H
00024 #define INCLUDED_USRP_SINK_S_H
00025 
00026 #include <usrp_sink_base.h>
00027 
00028 class usrp_sink_s;
00029 typedef boost::shared_ptr<usrp_sink_s> usrp_sink_s_sptr;
00030 
00031 
00032 // public shared_ptr constructor
00033 
00034 usrp_sink_s_sptr
00035 usrp_make_sink_s (int which_board=0,
00036                   unsigned int interp_rate=32,
00037                   int nchan=1,
00038                   int mux=-1,
00039                   int fusb_block_size=0,
00040                   int fusb_nblocks=0,
00041                   const std::string fpga_filename="",
00042                   const std::string firmware_filename=""
00043                   ) throw (std::runtime_error);
00044 
00045 /*!
00046  * \brief Interface to Universal Software Radio Peripheral Tx path
00047  * \ingroup usrp
00048  * \ingroup sink_blk
00049  *
00050  * input: short
00051  */
00052 class usrp_sink_s : public usrp_sink_base {
00053  private:
00054 
00055   friend usrp_sink_s_sptr
00056   usrp_make_sink_s (int which_board,
00057                      unsigned int interp_rate,
00058                      int nchan,
00059                      int mux,
00060                      int fusb_block_size,
00061                      int fusb_nblocks,
00062                      const std::string fpga_filename,
00063                      const std::string firmware_filename
00064                      ) throw (std::runtime_error);
00065 
00066  protected:
00067   usrp_sink_s (int which_board,
00068                 unsigned int interp_rate,
00069                 int nchan,
00070                 int mux,
00071                 int fusb_block_size,
00072                 int fusb_nblocks,
00073                 const std::string fpga_filename,
00074                 const std::string firmware_filename
00075                 ) throw (std::runtime_error);
00076 
00077   virtual void copy_to_usrp_buffer (gr_vector_const_void_star &input_items,
00078                                     int  input_index,
00079                                     int  input_items_available,
00080                                     int  &input_items_consumed,
00081                                     void *usrp_buffer,
00082                                     int  usrp_buffer_length,
00083                                     int  &bytes_written);
00084  public:
00085   ~usrp_sink_s ();
00086 };
00087 
00088 #endif /* INCLUDED_USRP_SINK_S_H */