Applied patch to cleanup msdd
[debian/gnuradio] / gr-msdd6000 / src / msdd_source_simple.h
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2008 Free Software Foundation, Inc.
4  * 
5  * This file is part of GNU Radio
6  * 
7  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  * 
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21 #ifndef INCLUDED_MSDD_SOURCE_SIMPLE_H
22 #define INCLUDED_MSDD_SOURCE_SIMPLE_H
23
24 #include <gr_sync_block.h>
25 #include <msdd6000.h>
26 #include <boost/scoped_ptr.hpp>
27
28 #define     MSDD_COMPLEX_SAMPLES_PER_PACKET        366
29
30 class msdd_source_simple;
31 typedef boost::shared_ptr<msdd_source_simple> msdd_source_simple_sptr;
32
33
34 // public shared_ptr constructor
35
36 msdd_source_simple_sptr msdd_make_source_simple ( const char *src, unsigned short port_src);
37
38
39 class msdd_source_simple : public gr_sync_block {
40  private:
41   friend msdd_source_simple_sptr
42   msdd_make_source_simple ( const char *src, unsigned short port_src);
43
44   boost::scoped_ptr<MSDD6000> rcv;
45   int d_lastseq;
46   bool d_firstrun;
47
48  protected:
49   msdd_source_simple (const char *src, unsigned short port_src);
50
51  public:
52   ~msdd_source_simple ();
53   bool stop();
54   bool start();
55
56   bool set_decim_rate(unsigned int);
57   bool set_rx_freq(int,double);
58   bool set_pga(int,double);
59
60   int work(int, gr_vector_const_void_star&, gr_vector_void_star&);
61   
62   long adc_freq();
63   int decim_rate();
64   std::vector<int> gain_range();
65   std::vector<float> freq_range();
66 };
67
68 #endif /* INCLUDED_MSDD_SOURCE_C_H */