diff options
author | Tom Rondeau | 2012-03-12 09:26:38 -0700 |
---|---|---|
committer | Johnathan Corgan | 2012-03-12 09:31:24 -0700 |
commit | 9ef789c8cca6b3439ecce5fc7aa71d3b073acfd7 (patch) | |
tree | 924a957a7e587f36ed8cd1bddd0f8cbf2dcff342 /gr-fcd | |
parent | 72576bd2d87b83ccc1661b695278e0dee8fe21a4 (diff) | |
download | gnuradio-9ef789c8cca6b3439ecce5fc7aa71d3b073acfd7.tar.gz gnuradio-9ef789c8cca6b3439ecce5fc7aa71d3b073acfd7.tar.bz2 gnuradio-9ef789c8cca6b3439ecce5fc7aa71d3b073acfd7.zip |
fcd: added FCD_API to code
Diffstat (limited to 'gr-fcd')
-rw-r--r-- | gr-fcd/include/fcd/CMakeLists.txt | 1 | ||||
-rw-r--r-- | gr-fcd/include/fcd/fcd_api.h | 33 | ||||
-rw-r--r-- | gr-fcd/include/fcd/fcd_source_c.h | 9 | ||||
-rw-r--r-- | gr-fcd/swig/fcd_source_c.i | 3 |
4 files changed, 40 insertions, 6 deletions
diff --git a/gr-fcd/include/fcd/CMakeLists.txt b/gr-fcd/include/fcd/CMakeLists.txt index bd3a73511..3ca70c2a1 100644 --- a/gr-fcd/include/fcd/CMakeLists.txt +++ b/gr-fcd/include/fcd/CMakeLists.txt @@ -21,6 +21,7 @@ # Install header files ######################################################################## install(FILES + fcd_api.h fcd_source_c.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio COMPONENT "fcd_devel" diff --git a/gr-fcd/include/fcd/fcd_api.h b/gr-fcd/include/fcd/fcd_api.h new file mode 100644 index 000000000..d6d1bd31f --- /dev/null +++ b/gr-fcd/include/fcd/fcd_api.h @@ -0,0 +1,33 @@ +/* + * Copyright 2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * 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 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_FCD_API_H +#define INCLUDED_FCD_API_H + +#include <gruel/attributes.h> + +#ifdef gnuradio_pager_EXPORTS +# define FCD_API __GR_ATTR_EXPORT +#else +# define FCD_API __GR_ATTR_IMPORT +#endif + +#endif /* INCLUDED_FCD_API_H */ diff --git a/gr-fcd/include/fcd/fcd_source_c.h b/gr-fcd/include/fcd/fcd_source_c.h index 9a0c69403..1649d0862 100644 --- a/gr-fcd/include/fcd/fcd_source_c.h +++ b/gr-fcd/include/fcd/fcd_source_c.h @@ -21,6 +21,7 @@ #ifndef INCLUDED_FCD_SOURCE_C_H #define INCLUDED_FCD_SOURCE_C_H +#include <fcd_api.h> #include <gr_hier_block2.h> #include <gr_audio_source.h> @@ -37,7 +38,7 @@ typedef boost::shared_ptr<fcd_source_c> fcd_source_c_sptr; * of raw pointers, fcd_source_c's constructor is private. * fcd_make_source_c is the public interface for creating new instances. */ -fcd_source_c_sptr fcd_make_source_c(const std::string device_name = ""); +FCD_API fcd_source_c_sptr fcd_make_source_c(const std::string device_name = ""); /*! \brief Funcube Dongle source block. * @@ -49,11 +50,10 @@ fcd_source_c_sptr fcd_make_source_c(const std::string device_name = ""); * interface to work properly. As of early 2011, FCDs still come with firmware * 18b. You can use qthid 2.2 (not 3) to upgrade the firmware: http://qthid.sf.net */ -class fcd_source_c : public gr_hier_block2 +class FCD_API fcd_source_c : public gr_hier_block2 { public: - fcd_source_c(const std::string device_name = ""); // FIXME: should be private ~fcd_source_c(); /*! \brief Set frequency with Hz resolution. @@ -127,6 +127,9 @@ public: void set_iq_corr(double _gain, double _phase); private: + fcd_source_c(const std::string device_name = ""); + friend FCD_API fcd_source_c_sptr + fcd_make_source_c(const std::string device_name); audio_source::sptr fcd; /*!< The audio input source */ int d_freq_corr; /*!< The frequency correction in ppm */ diff --git a/gr-fcd/swig/fcd_source_c.i b/gr-fcd/swig/fcd_source_c.i index 03223b40b..3438ab74d 100644 --- a/gr-fcd/swig/fcd_source_c.i +++ b/gr-fcd/swig/fcd_source_c.i @@ -12,9 +12,6 @@ fcd_source_c_sptr fcd_make_source_c (const std::string device_name = ""); class fcd_source_c : public gr_hier_block2 { public: - fcd_source_c (const std::string device_name = ""); - ~fcd_source_c(); - void set_freq(float freq); void set_freq_khz(int freq); void set_lna_gain(float gain); |