GNU Radio 3.4.0 C++ API
msdd_rs_source_simple.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2008 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 along
00018  * with this program; if not, write to the Free Software Foundation, Inc.,
00019  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00020  */
00021 #ifndef INCLUDED_MSDD_RS_SOURCE_SIMPLE_H
00022 #define INCLUDED_MSDD_RS_SOURCE_SIMPLE_H
00023 
00024 #include <gr_sync_block.h>
00025 #include <msdd6000_rs.h>
00026 #include <boost/scoped_ptr.hpp>
00027 
00028 class msdd_rs_source_simple;
00029 typedef boost::shared_ptr<msdd_rs_source_simple> msdd_rs_source_simple_sptr;
00030 
00031 
00032 // public shared_ptr constructor
00033 
00034 msdd_rs_source_simple_sptr msdd_rs_make_source_simple ( const char *src, unsigned short port_src);
00035 
00036 
00037 class msdd_rs_source_simple : public gr_sync_block {
00038  private:
00039   friend msdd_rs_source_simple_sptr
00040   msdd_rs_make_source_simple ( const char *src, unsigned short port_src);
00041 
00042   boost::scoped_ptr<MSDD6000_RS> rcv;
00043   int d_lastseq;
00044 
00045  protected:
00046   msdd_rs_source_simple (const char *src, unsigned short port_src);
00047 
00048  public:
00049   ~msdd_rs_source_simple ();
00050   bool stop();
00051   bool start();
00052 
00053   /* function starts the flow of data from the digitizer */
00054   int start_data();
00055   /* function stops the flow of data from the digitizer */
00056   int stop_data();
00057 
00058   // Do not need this //
00059 //  bool set_decim_rate(unsigned int);
00060   /* Adding functions for setting the sample rate and
00061   * receiver bandwidth
00062   */
00063   
00064   /* hardware commands -- change current state of digitizer */
00065   bool set_ddc_samp_rate(double);
00066   bool set_ddc_bw(double);
00067   
00068   bool set_rx_freq(double);
00069   bool set_ddc_gain(double);
00070   bool set_rf_atten(double);
00071 
00072   int work(int, gr_vector_const_void_star&, gr_vector_void_star&);
00073   
00074   /* Query methods -- query current state of digitizer */
00075   long  pull_adc_freq();
00076   float pull_ddc_samp_rate();
00077   float pull_ddc_bw();
00078   float pull_rx_freq();
00079   int   pull_ddc_gain();
00080   int   pull_rf_atten();
00081   
00082   /* Pulling back gain and frequency ranges */
00083   std::vector<int> gain_range();
00084   std::vector<float> freq_range();
00085 };
00086 
00087 #endif /* INCLUDED_MSDD_RS__RS__SOURCE_C_H */