diff options
Diffstat (limited to 'host/include')
23 files changed, 257 insertions, 108 deletions
diff --git a/host/include/uhd/CMakeLists.txt b/host/include/uhd/CMakeLists.txt index 522f43afd..3d00462cf 100644 --- a/host/include/uhd/CMakeLists.txt +++ b/host/include/uhd/CMakeLists.txt @@ -20,6 +20,7 @@ ADD_SUBDIRECTORY(transport) ADD_SUBDIRECTORY(usrp) INSTALL(FILES + config.hpp device.hpp device_addr.hpp dict.hpp @@ -28,6 +29,7 @@ INSTALL(FILES props.hpp simple_device.hpp time_spec.hpp + types.hpp utils.hpp wax.hpp DESTINATION ${HEADER_DIR}/uhd diff --git a/host/include/uhd/config.hpp b/host/include/uhd/config.hpp new file mode 100644 index 000000000..10f9c093f --- /dev/null +++ b/host/include/uhd/config.hpp @@ -0,0 +1,76 @@ +//
+// Copyright 2010 Ettus Research LLC
+//
+// This program 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 of the License, or
+// (at your option) any later version.
+//
+// This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+//
+
+#ifndef INCLUDED_UHD_CONFIG_HPP
+#define INCLUDED_UHD_CONFIG_HPP
+
+// suppress warnings
+#include <boost/config.hpp>
+#ifdef BOOST_MSVC
+# pragma warning(push)
+//# pragma warning(disable: 4511) // copy constructor can't not be generated
+//# pragma warning(disable: 4512) // assignment operator can't not be generated
+//# pragma warning(disable: 4100) // unreferenced formal parameter
+//# pragma warning(disable: 4996) // <symbol> was declared deprecated
+//# pragma warning(disable: 4355) // 'this' : used in base member initializer list
+//# pragma warning(disable: 4706) // assignment within conditional expression
+# pragma warning(disable: 4251) // class 'A<T>' needs to have dll-interface to be used by clients of class 'B'
+//# pragma warning(disable: 4127) // conditional expression is constant
+//# pragma warning(disable: 4290) // C++ exception specification ignored except to ...
+//# pragma warning(disable: 4180) // qualifier applied to function type has no meaning; ignored
+# pragma warning(disable: 4275) // non dll-interface class ... used as base for dll-interface class ...
+//# pragma warning(disable: 4267) // 'var' : conversion from 'size_t' to 'type', possible loss of data
+//# pragma warning(disable: 4511) // 'class' : copy constructor could not be generated
+#endif
+
+// http://gcc.gnu.org/wiki/Visibility
+// Generic helper definitions for shared library support
+#if defined _WIN32 || defined __CYGWIN__
+ #define UHD_HELPER_DLL_IMPORT __declspec(dllimport)
+ #define UHD_HELPER_DLL_EXPORT __declspec(dllexport)
+ #define UHD_HELPER_DLL_LOCAL
+#else
+ #if __GNUC__ >= 4
+ #define UHD_HELPER_DLL_IMPORT __attribute__ ((visibility("default")))
+ #define UHD_HELPER_DLL_EXPORT __attribute__ ((visibility("default")))
+ #define UHD_HELPER_DLL_LOCAL __attribute__ ((visibility("hidden")))
+ #else
+ #define UHD_HELPER_DLL_IMPORT
+ #define UHD_HELPER_DLL_EXPORT
+ #define UHD_HELPER_DLL_LOCAL
+ #endif
+#endif
+
+// Now we use the generic helper definitions above to define UHD_API and UHD_LOCAL.
+// UHD_API is used for the public API symbols. It either DLL imports or DLL exports (or does nothing for static build)
+// UHD_LOCAL is used for non-api symbols.
+
+#define UHD_DLL // defined here, put into configuration if we need to make static libs
+
+#ifdef UHD_DLL // defined if UHD is compiled as a DLL
+ #ifdef UHD_DLL_EXPORTS // defined if we are building the UHD DLL (instead of using it)
+ #define UHD_API UHD_HELPER_DLL_EXPORT
+ #else
+ #define UHD_API UHD_HELPER_DLL_IMPORT
+ #endif // UHD_DLL_EXPORTS
+ #define UHD_LOCAL UHD_HELPER_DLL_LOCAL
+#else // UHD_DLL is not defined: this means UHD is a static lib.
+ #define UHD_API
+ #define UHD_LOCAL
+#endif // UHD_DLL
+
+#endif /* INCLUDED_UHD_CONFIG_HPP */
diff --git a/host/include/uhd/device.hpp b/host/include/uhd/device.hpp index c9d608bcf..13b40febe 100644 --- a/host/include/uhd/device.hpp +++ b/host/include/uhd/device.hpp @@ -18,6 +18,7 @@ #ifndef INCLUDED_UHD_DEVICE_HPP #define INCLUDED_UHD_DEVICE_HPP +#include <uhd/config.hpp> #include <uhd/device_addr.hpp> #include <uhd/props.hpp> #include <uhd/metadata.hpp> @@ -33,7 +34,7 @@ namespace uhd{ * The usrp device interface represents the usrp hardware. * The api allows for discovery, configuration, and streaming. */ -class device : boost::noncopyable, public wax::obj{ +class UHD_API device : boost::noncopyable, public wax::obj{ public: typedef boost::shared_ptr<device> sptr; @@ -76,11 +77,6 @@ public: static sptr make(const device_addr_t &hint, size_t which = 0); /*! - * Get the device address for this board. - */ - device_addr_t get_device_addr(void); - - /*! * Send a buffer containing IF data with its metadata. * * Send handles fragmentation as follows: diff --git a/host/include/uhd/device_addr.hpp b/host/include/uhd/device_addr.hpp index 1b624b770..7673faff0 100644 --- a/host/include/uhd/device_addr.hpp +++ b/host/include/uhd/device_addr.hpp @@ -18,6 +18,7 @@ #ifndef INCLUDED_UHD_DEVICE_ADDR_HPP #define INCLUDED_UHD_DEVICE_ADDR_HPP +#include <uhd/config.hpp> #include <uhd/dict.hpp> #include <boost/cstdint.hpp> #include <string> @@ -30,7 +31,7 @@ namespace uhd{ * Wrapper for an ethernet mac address. * Provides conversion between string and binary formats. */ - struct mac_addr_t{ + struct UHD_API mac_addr_t{ boost::uint8_t mac_addr[6]; mac_addr_t(const std::string &mac_addr_str = "00:00:00:00:00:00"); std::string to_string(void) const; @@ -56,13 +57,13 @@ namespace uhd{ * \return the string representation */ namespace device_addr{ - std::string to_string(const device_addr_t &device_addr); + UHD_API std::string to_string(const device_addr_t &device_addr); } } //namespace uhd //ability to use types with stream operators -std::ostream& operator<<(std::ostream &, const uhd::device_addr_t &); -std::ostream& operator<<(std::ostream &, const uhd::mac_addr_t &); +UHD_API std::ostream& operator<<(std::ostream &, const uhd::device_addr_t &); +UHD_API std::ostream& operator<<(std::ostream &, const uhd::mac_addr_t &); #endif /* INCLUDED_UHD_DEVICE_ADDR_HPP */ diff --git a/host/include/uhd/dict.hpp b/host/include/uhd/dict.hpp index 8f7cd5a0f..f08493952 100644 --- a/host/include/uhd/dict.hpp +++ b/host/include/uhd/dict.hpp @@ -40,6 +40,19 @@ namespace uhd{ } /*! + * Input iterator constructor: + * Makes boost::assign::map_list_of work. + * \param first the begin iterator + * \param last the end iterator + */ + template <class InputIterator> + dict(InputIterator first, InputIterator last){ + for(InputIterator it = first; it != last; it++){ + _map.push_back(*it); + } + } + + /*! * Destroy this dict. */ ~dict(void){ diff --git a/host/include/uhd/gain_handler.hpp b/host/include/uhd/gain_handler.hpp index a71d63c84..65d6cecf9 100644 --- a/host/include/uhd/gain_handler.hpp +++ b/host/include/uhd/gain_handler.hpp @@ -15,16 +15,17 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // +#ifndef INCLUDED_UHD_GAIN_HANDLER_HPP +#define INCLUDED_UHD_GAIN_HANDLER_HPP + +#include <uhd/config.hpp> #include <uhd/wax.hpp> #include <boost/shared_ptr.hpp> #include <boost/function.hpp> -#ifndef INCLUDED_UHD_GAIN_HANDLER_HPP -#define INCLUDED_UHD_GAIN_HANDLER_HPP - namespace uhd{ -class gain_handler{ +class UHD_API gain_handler{ public: typedef boost::shared_ptr<gain_handler> sptr; typedef boost::function<bool(const wax::obj &, const wax::obj &)> is_equal_t; @@ -32,7 +33,7 @@ public: /*! * A set of properties for dealing with gains. */ - struct props_t{ + struct UHD_API props_t{ wax::obj value, range, names; props_t(void); //default constructor }; diff --git a/host/include/uhd/metadata.hpp b/host/include/uhd/metadata.hpp index ce72ff14b..6d80f070d 100644 --- a/host/include/uhd/metadata.hpp +++ b/host/include/uhd/metadata.hpp @@ -18,6 +18,7 @@ #ifndef INCLUDED_UHD_METADATA_HPP #define INCLUDED_UHD_METADATA_HPP +#include <uhd/config.hpp> #include <uhd/time_spec.hpp> namespace uhd{ @@ -27,7 +28,7 @@ namespace uhd{ * Includes stream ID, time specification, and fragmentation flags. * The receive routines will convert IF data headers into metadata. */ -struct rx_metadata_t{ +struct UHD_API rx_metadata_t{ boost::uint32_t stream_id; time_spec_t time_spec; bool has_stream_id; @@ -43,7 +44,7 @@ struct rx_metadata_t{ * Includes stream ID, time specification, and burst flags. * The send routines will convert the metadata to IF data headers. */ -struct tx_metadata_t{ +struct UHD_API tx_metadata_t{ boost::uint32_t stream_id; time_spec_t time_spec; bool has_stream_id; diff --git a/host/include/uhd/props.hpp b/host/include/uhd/props.hpp index 6d4414d3a..41e0eff63 100644 --- a/host/include/uhd/props.hpp +++ b/host/include/uhd/props.hpp @@ -15,36 +15,16 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // -#include <boost/tuple/tuple.hpp> -#include <uhd/time_spec.hpp> -#include <uhd/wax.hpp> -#include <complex> -#include <vector> - #ifndef INCLUDED_UHD_PROPS_HPP #define INCLUDED_UHD_PROPS_HPP -namespace uhd{ - - //common typedefs for board properties - typedef float gain_t; - typedef double freq_t; - - //gain range tuple (min, max, step) - typedef boost::tuple<gain_t, gain_t, gain_t> gain_range_t; - - //freq range tuple (min, max) - typedef boost::tuple<freq_t, freq_t> freq_range_t; - - //scalar types (have not used yet, dont uncomment until needed) - //typedef int int_scalar_t; - //typedef float real_scalar_t; - //typedef std::complex<real_scalar_t> complex_scalar_t; +#include <uhd/config.hpp> +#include <uhd/wax.hpp> +#include <boost/tuple/tuple.hpp> +#include <vector> +#include <string> - //vector types (have not used yet, dont uncomment until needed) - //typedef std::vector<int_scalar_t> int_vec_t; - //typedef std::vector<real_scalar_t> real_vec_t; - //typedef std::vector<complex_scalar_t> complex_vec_t; +namespace uhd{ //typedef for handling named properties typedef std::vector<std::string> prop_names_t; @@ -55,7 +35,8 @@ namespace uhd{ * \param key a reference to the prop object * \param name a reference to the name object */ - inline named_prop_t extract_named_prop(const wax::obj &key, const std::string &name = ""){ + inline UHD_API named_prop_t //must be exported as part of the api to work (TODO move guts to cpp file) + extract_named_prop(const wax::obj &key, const std::string &name = ""){ if (key.type() == typeid(named_prop_t)){ return key.as<named_prop_t>(); } @@ -94,10 +75,8 @@ namespace uhd{ MBOARD_PROP_RX_DBOARD_NAMES, //ro, prop_names_t MBOARD_PROP_TX_DBOARD, //ro, wax::obj MBOARD_PROP_TX_DBOARD_NAMES, //ro, prop_names_t - MBOARD_PROP_PPS_SOURCE, //rw, std::string (sma, mimo) + MBOARD_PROP_CLOCK_CONFIG, //rw, clock_config_t MBOARD_PROP_PPS_SOURCE_NAMES, //ro, prop_names_t - MBOARD_PROP_PPS_POLARITY, //rw, std::string (pos, neg) - MBOARD_PROP_REF_SOURCE, //rw, std::string (int, sma, mimo) MBOARD_PROP_REF_SOURCE_NAMES, //ro, prop_names_t MBOARD_PROP_TIME_NOW, //wo, time_spec_t MBOARD_PROP_TIME_NEXT_PPS //wo, time_spec_t diff --git a/host/include/uhd/simple_device.hpp b/host/include/uhd/simple_device.hpp index c43155ff2..ad25eccdc 100644 --- a/host/include/uhd/simple_device.hpp +++ b/host/include/uhd/simple_device.hpp @@ -15,40 +15,25 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // +#ifndef INCLUDED_UHD_SIMPLE_DEVICE_HPP +#define INCLUDED_UHD_SIMPLE_DEVICE_HPP + +#include <uhd/config.hpp> +#include <uhd/device.hpp> +#include <uhd/types.hpp> #include <boost/shared_ptr.hpp> #include <boost/utility.hpp> -#include <uhd/device.hpp> #include <vector> -#ifndef INCLUDED_UHD_SIMPLE_DEVICE_HPP -#define INCLUDED_UHD_SIMPLE_DEVICE_HPP - namespace uhd{ /*! - * The tune result struct holds result of a 2-phase tuning: - * The struct hold the result of tuning the dboard as - * the target and actual intermediate frequency. - * The struct hold the result of tuning the DDC/DUC as - * the target and actual digital converter frequency. - * It also tell us weather or not the spectrum is inverted. - */ -struct tune_result_t{ - double target_inter_freq; - double actual_inter_freq; - double target_dxc_freq; - double actual_dxc_freq; - bool spectrum_inverted; - tune_result_t(void); -}; - -/*! * The simple UHD device class: * A simple device facilitates ease-of-use for most use-case scenarios. * The wrapper provides convenience functions to tune the devices * as well as to set the dboard gains, antennas, and other properties. */ -class simple_device : boost::noncopyable{ +class UHD_API simple_device : boost::noncopyable{ public: typedef boost::shared_ptr<simple_device> sptr; static sptr make(const std::string &args); @@ -71,11 +56,11 @@ public: virtual std::vector<double> get_rx_rates(void) = 0; virtual tune_result_t set_rx_freq(double freq) = 0; - virtual std::vector<double> get_rx_freq_range(void) = 0; + virtual freq_range_t get_rx_freq_range(void) = 0; virtual void set_rx_gain(float gain) = 0; virtual float get_rx_gain(void) = 0; - virtual std::vector<float> get_rx_gain_range(void) = 0; + virtual gain_range_t get_rx_gain_range(void) = 0; virtual void set_rx_antenna(const std::string &ant) = 0; virtual std::string get_rx_antenna(void) = 0; @@ -89,11 +74,11 @@ public: virtual std::vector<double> get_tx_rates(void) = 0; virtual tune_result_t set_tx_freq(double freq) = 0; - virtual std::vector<double> get_tx_freq_range(void) = 0; + virtual freq_range_t get_tx_freq_range(void) = 0; virtual void set_tx_gain(float gain) = 0; virtual float get_tx_gain(void) = 0; - virtual std::vector<float> get_tx_gain_range(void) = 0; + virtual gain_range_t get_tx_gain_range(void) = 0; virtual void set_tx_antenna(const std::string &ant) = 0; virtual std::string get_tx_antenna(void) = 0; diff --git a/host/include/uhd/time_spec.hpp b/host/include/uhd/time_spec.hpp index 588758824..c1e7cf3a1 100644 --- a/host/include/uhd/time_spec.hpp +++ b/host/include/uhd/time_spec.hpp @@ -15,12 +15,13 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // -#include <boost/date_time/posix_time/posix_time.hpp> -#include <boost/cstdint.hpp> - #ifndef INCLUDED_UHD_TIME_SPEC_HPP #define INCLUDED_UHD_TIME_SPEC_HPP +#include <uhd/config.hpp> +#include <boost/cstdint.hpp> +#include <boost/date_time/posix_time/posix_time.hpp> + namespace uhd{ /*! @@ -29,7 +30,7 @@ namespace uhd{ * The time_spec_t can be used when setting the time on devices * and for controlling the start of streaming for applicable dsps. */ - struct time_spec_t{ + struct UHD_API time_spec_t{ boost::uint32_t secs; boost::uint32_t ticks; diff --git a/host/include/uhd/transport/smart_buffer.hpp b/host/include/uhd/transport/smart_buffer.hpp index 914c02f50..9e1032feb 100644 --- a/host/include/uhd/transport/smart_buffer.hpp +++ b/host/include/uhd/transport/smart_buffer.hpp @@ -15,13 +15,13 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // +#ifndef INCLUDED_UHD_TRANSPORT_SMART_BUFFER_HPP +#define INCLUDED_UHD_TRANSPORT_SMART_BUFFER_HPP + #include <boost/asio.hpp> #include <boost/utility.hpp> #include <boost/shared_ptr.hpp> -#ifndef INCLUDED_UHD_TRANSPORT_SMART_BUFFER_HPP -#define INCLUDED_UHD_TRANSPORT_SMART_BUFFER_HPP - namespace uhd{ namespace transport{ /*! diff --git a/host/include/uhd/transport/udp_simple.hpp b/host/include/uhd/transport/udp_simple.hpp index 0d8fcc5f0..40e60d091 100644 --- a/host/include/uhd/transport/udp_simple.hpp +++ b/host/include/uhd/transport/udp_simple.hpp @@ -15,16 +15,17 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // +#ifndef INCLUDED_UHD_TRANSPORT_UDP_SIMPLE_HPP +#define INCLUDED_UHD_TRANSPORT_UDP_SIMPLE_HPP + +#include <uhd/config.hpp> #include <boost/asio.hpp> #include <boost/utility.hpp> #include <boost/shared_ptr.hpp> -#ifndef INCLUDED_UHD_TRANSPORT_UDP_SIMPLE_HPP -#define INCLUDED_UHD_TRANSPORT_UDP_SIMPLE_HPP - namespace uhd{ namespace transport{ -class udp_simple : boost::noncopyable{ +class UHD_API udp_simple : boost::noncopyable{ public: typedef boost::shared_ptr<udp_simple> sptr; diff --git a/host/include/uhd/transport/udp_zero_copy.hpp b/host/include/uhd/transport/udp_zero_copy.hpp index 1a8d822fd..03d89b3a5 100644 --- a/host/include/uhd/transport/udp_zero_copy.hpp +++ b/host/include/uhd/transport/udp_zero_copy.hpp @@ -15,14 +15,15 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // +#ifndef INCLUDED_UHD_TRANSPORT_UDP_ZERO_COPY_HPP +#define INCLUDED_UHD_TRANSPORT_UDP_ZERO_COPY_HPP + +#include <uhd/config.hpp> #include <uhd/transport/smart_buffer.hpp> #include <boost/asio.hpp> #include <boost/utility.hpp> #include <boost/shared_ptr.hpp> -#ifndef INCLUDED_UHD_TRANSPORT_UDP_ZERO_COPY_HPP -#define INCLUDED_UHD_TRANSPORT_UDP_ZERO_COPY_HPP - namespace uhd{ namespace transport{ /*! @@ -35,7 +36,7 @@ namespace uhd{ namespace transport{ * If no platform specific solution is available, make returns a boost asio * implementation that wraps the functionality around a standard recv() call. */ -class udp_zero_copy : boost::noncopyable{ +class UHD_API udp_zero_copy : boost::noncopyable{ public: typedef boost::shared_ptr<udp_zero_copy> sptr; diff --git a/host/include/uhd/transport/vrt.hpp b/host/include/uhd/transport/vrt.hpp index 3b5bf41bf..db2c57eba 100644 --- a/host/include/uhd/transport/vrt.hpp +++ b/host/include/uhd/transport/vrt.hpp @@ -15,12 +15,13 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // -#include <uhd/metadata.hpp> -#include <cstddef> - #ifndef INCLUDED_UHD_TRANSPORT_VRT_HPP #define INCLUDED_UHD_TRANSPORT_VRT_HPP +#include <uhd/config.hpp> +#include <uhd/metadata.hpp> +#include <cstddef> + namespace uhd{ namespace transport{ namespace vrt{ @@ -36,7 +37,7 @@ namespace vrt{ * \param num_packet_words32 the length of the packet * \param packet_count the packet count sequence number */ - void pack( + UHD_API void pack( const tx_metadata_t &metadata, //input boost::uint32_t *header_buff, //output size_t &num_header_words32, //output @@ -54,7 +55,7 @@ namespace vrt{ * \param num_packet_words32 the length of the packet * \param packet_count the packet count sequence number */ - void unpack( + UHD_API void unpack( rx_metadata_t &metadata, //output const boost::uint32_t *header_buff, //input size_t &num_header_words32, //output diff --git a/host/include/uhd/types.hpp b/host/include/uhd/types.hpp new file mode 100644 index 000000000..1439f57a1 --- /dev/null +++ b/host/include/uhd/types.hpp @@ -0,0 +1,83 @@ +// +// Copyright 2010 Ettus Research LLC +// +// This program 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 of the License, or +// (at your option) any later version. +// +// This program 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 this program. If not, see <http://www.gnu.org/licenses/>. +// + +#ifndef INCLUDED_UHD_TYPES_HPP +#define INCLUDED_UHD_TYPES_HPP + +#include <uhd/config.hpp> +#include <string> + +namespace uhd{ + + typedef float gain_t; //TODO REMOVE + typedef double freq_t; //TODO REMOVE + + /*! + * The gain range struct describes possible gain settings. + * The mimumum gain, maximum gain, and step size are in dB. + */ + struct UHD_API gain_range_t{ + float min, max, step; + gain_range_t(float min = 0.0, float max = 0.0, float step = 0.0); + }; + + /*! + * The frequency range struct describes possible frequency settings. + * Because tuning is very granular (sub-Hz), step size is not listed. + * The mimumum frequency and maximum frequency are in Hz. + */ + struct UHD_API freq_range_t{ + double min, max; + freq_range_t(double min = 0.0, double max = 0.0); + }; + + /*! + * The tune result struct holds result of a 2-phase tuning: + * The struct hold the result of tuning the dboard as + * the target and actual intermediate frequency. + * The struct hold the result of tuning the DDC/DUC as + * the target and actual digital converter frequency. + * It also tell us weather or not the spectrum is inverted. + */ + struct UHD_API tune_result_t{ + double target_inter_freq; + double actual_inter_freq; + double target_dxc_freq; + double actual_dxc_freq; + bool spectrum_inverted; + tune_result_t(void); + }; + + /*! + * Clock configuration settings: + * The source for the 10MHz reference clock. + * The source and polarity for the PPS clock. + * Possible settings for the reference and pps source + * are implementation specific motherboard properties. + * See the MBOARD_PROP_XXX_SOURCE_NAMES properties. + */ + struct clock_config_t{ + enum polarity_t {POLARITY_NEG, POLARITY_POS}; + std::string ref_source; + std::string pps_source; + polarity_t pps_polarity; + clock_config_t(void); + }; + +} //namespace uhd + +#endif /* INCLUDED_UHD_TYPES_HPP */ diff --git a/host/include/uhd/usrp/dboard_base.hpp b/host/include/uhd/usrp/dboard_base.hpp index 9048344ac..907a7814a 100644 --- a/host/include/uhd/usrp/dboard_base.hpp +++ b/host/include/uhd/usrp/dboard_base.hpp @@ -18,6 +18,7 @@ #ifndef INCLUDED_UHD_USRP_DBOARD_BASE_HPP #define INCLUDED_UHD_USRP_DBOARD_BASE_HPP +#include <uhd/config.hpp> #include <uhd/wax.hpp> #include <boost/utility.hpp> #include <boost/shared_ptr.hpp> @@ -31,7 +32,7 @@ namespace uhd{ namespace usrp{ * A daughter board dboard_base class for all dboards. * Only other dboard dboard_base classes should inherit this. */ -class dboard_base : boost::noncopyable{ +class UHD_API dboard_base : boost::noncopyable{ public: typedef boost::shared_ptr<dboard_base> sptr; //the constructor args consist of a subdev name and an interface @@ -65,7 +66,7 @@ private: * A xcvr daughter board implements rx and tx methods * Sub classes for xcvr boards should inherit this. */ -class xcvr_dboard_base : public dboard_base{ +class UHD_API xcvr_dboard_base : public dboard_base{ public: /*! * Create a new xcvr dboard object, override in subclasses. @@ -79,7 +80,7 @@ public: * A rx daughter board only implements rx methods. * Sub classes for rx-only boards should inherit this. */ -class rx_dboard_base : public dboard_base{ +class UHD_API rx_dboard_base : public dboard_base{ public: /*! * Create a new rx dboard object, override in subclasses. @@ -97,7 +98,7 @@ public: * A tx daughter board only implements tx methods. * Sub classes for rx-only boards should inherit this. */ -class tx_dboard_base : public dboard_base{ +class UHD_API tx_dboard_base : public dboard_base{ public: /*! * Create a new rx dboard object, override in subclasses. diff --git a/host/include/uhd/usrp/dboard_id.hpp b/host/include/uhd/usrp/dboard_id.hpp index 370cd1fbb..4b2392bee 100644 --- a/host/include/uhd/usrp/dboard_id.hpp +++ b/host/include/uhd/usrp/dboard_id.hpp @@ -15,12 +15,13 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // -#include <boost/cstdint.hpp> -#include <string> - #ifndef INCLUDED_UHD_USRP_DBOARD_ID_HPP #define INCLUDED_UHD_USRP_DBOARD_ID_HPP +#include <uhd/config.hpp> +#include <boost/cstdint.hpp> +#include <string> + namespace uhd{ namespace usrp{ typedef boost::uint16_t dboard_id_t; @@ -29,7 +30,7 @@ static const dboard_id_t ID_NONE = 0xffff; //TODO: REMOVE ME namespace dboard_id{ static const dboard_id_t NONE = 0xffff; - std::string to_string(const dboard_id_t &id); + UHD_API std::string to_string(const dboard_id_t &id); } }} //namespace diff --git a/host/include/uhd/usrp/dboard_interface.hpp b/host/include/uhd/usrp/dboard_interface.hpp index b00643550..5b40616f0 100644 --- a/host/include/uhd/usrp/dboard_interface.hpp +++ b/host/include/uhd/usrp/dboard_interface.hpp @@ -18,6 +18,7 @@ #ifndef INCLUDED_UHD_USRP_DBOARD_INTERFACE_HPP #define INCLUDED_UHD_USRP_DBOARD_INTERFACE_HPP +#include <uhd/config.hpp> #include <boost/shared_ptr.hpp> #include <boost/cstdint.hpp> #include <vector> @@ -30,7 +31,7 @@ namespace uhd{ namespace usrp{ * This dboard_interface provides i2c, spi, gpio, atr, aux dac/adc access. * Each mboard should have a specially tailored dboard dboard_interface. */ -class dboard_interface{ +class UHD_API dboard_interface{ public: typedef boost::shared_ptr<dboard_interface> sptr; typedef std::vector<boost::uint8_t> byte_vector_t; diff --git a/host/include/uhd/usrp/dboard_manager.hpp b/host/include/uhd/usrp/dboard_manager.hpp index 0c32c6dba..6a105d1de 100644 --- a/host/include/uhd/usrp/dboard_manager.hpp +++ b/host/include/uhd/usrp/dboard_manager.hpp @@ -18,6 +18,7 @@ #ifndef INCLUDED_UHD_USRP_DBOARD_MANAGER_HPP #define INCLUDED_UHD_USRP_DBOARD_MANAGER_HPP +#include <uhd/config.hpp> #include <uhd/props.hpp> #include <uhd/usrp/dboard_base.hpp> #include <uhd/usrp/dboard_id.hpp> @@ -31,7 +32,7 @@ namespace uhd{ namespace usrp{ * Create subdev instances for each subdev on a dboard. * Provide wax::obj access to the subdevs inside. */ -class dboard_manager : boost::noncopyable{ +class UHD_API dboard_manager : boost::noncopyable{ public: typedef boost::shared_ptr<dboard_manager> sptr; diff --git a/host/include/uhd/usrp/usrp1e.hpp b/host/include/uhd/usrp/usrp1e.hpp index 60a6a191a..f4cc39d8e 100644 --- a/host/include/uhd/usrp/usrp1e.hpp +++ b/host/include/uhd/usrp/usrp1e.hpp @@ -18,6 +18,7 @@ #ifndef INCLUDED_UHD_USRP_USRP1E_HPP #define INCLUDED_UHD_USRP_USRP1E_HPP +#include <uhd/config.hpp> #include <uhd/device.hpp> namespace uhd{ namespace usrp{ @@ -25,7 +26,7 @@ namespace uhd{ namespace usrp{ /*! * The usrp1e device class. */ -class usrp1e : public device{ +class UHD_API usrp1e : public device{ public: /*! * Discover usrp1e devices on the system via the device node. diff --git a/host/include/uhd/usrp/usrp2.hpp b/host/include/uhd/usrp/usrp2.hpp index b13786546..277ddc131 100644 --- a/host/include/uhd/usrp/usrp2.hpp +++ b/host/include/uhd/usrp/usrp2.hpp @@ -18,6 +18,7 @@ #ifndef INCLUDED_UHD_USRP_USRP2_HPP #define INCLUDED_UHD_USRP_USRP2_HPP +#include <uhd/config.hpp> #include <uhd/device.hpp> namespace uhd{ namespace usrp{ @@ -25,7 +26,7 @@ namespace uhd{ namespace usrp{ /*! * The usrp2 device class. */ -class usrp2 : public device{ +class UHD_API usrp2 : public device{ public: /*! * Discover usrp2 devices over the ethernet. diff --git a/host/include/uhd/utils.hpp b/host/include/uhd/utils.hpp index 995cb9926..e5333539f 100644 --- a/host/include/uhd/utils.hpp +++ b/host/include/uhd/utils.hpp @@ -18,10 +18,11 @@ #ifndef INCLUDED_UHD_UTILS_HPP #define INCLUDED_UHD_UTILS_HPP -#include <stdexcept> -#include <algorithm> +#include <uhd/config.hpp> #include <boost/format.hpp> #include <boost/current_function.hpp> +#include <stdexcept> +#include <algorithm> /*! * Defines a function that implements the "construct on first use" idiom diff --git a/host/include/uhd/wax.hpp b/host/include/uhd/wax.hpp index 0291a06b7..30645f491 100644 --- a/host/include/uhd/wax.hpp +++ b/host/include/uhd/wax.hpp @@ -18,6 +18,7 @@ #ifndef INCLUDED_WAX_HPP #define INCLUDED_WAX_HPP +#include <uhd/config.hpp> #include <boost/any.hpp> /*! @@ -59,7 +60,7 @@ namespace wax{ * For property nesting, wax obj subclasses return special links * to other wax obj subclasses, and the api handles the magic. */ - class obj{ + class UHD_API obj{ public: /*! |