summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.common5
-rw-r--r--config/ax_boost_date_time.m4110
-rw-r--r--config/ax_boost_program_options.m4105
-rw-r--r--config/ax_boost_system.m4117
-rw-r--r--configure.ac31
-rw-r--r--include/usrp_uhd/device.hpp6
-rw-r--r--include/usrp_uhd/props.hpp33
-rw-r--r--include/usrp_uhd/usrp/dboard/interface.hpp13
-rw-r--r--include/usrp_uhd/utils.hpp2
-rw-r--r--lib/usrp/mboard/test.cpp6
-rw-r--r--test/usrp_dboard_test.cpp2
11 files changed, 402 insertions, 28 deletions
diff --git a/Makefile.common b/Makefile.common
index 7bbee585f..a15f79f07 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -13,6 +13,9 @@ GENERAL_CPPFLAGS = \
$(BOOST_CPPFLAGS)
GENERAL_LDDFLAGS = \
- $(BOOST_LDFLAGS) \
$(BOOST_ASIO_LIB) \
+ $(BOOST_DATE_TIME_LIB) \
+ $(BOOST_LDFLAGS) \
+ $(BOOST_PROGRAM_OPTIONS_LIB) \
+ $(BOOST_SYSTEM_LIB) \
$(BOOST_THREAD_LIB)
diff --git a/config/ax_boost_date_time.m4 b/config/ax_boost_date_time.m4
new file mode 100644
index 000000000..96e3f97c6
--- /dev/null
+++ b/config/ax_boost_date_time.m4
@@ -0,0 +1,110 @@
+# ===========================================================================
+# http://www.nongnu.org/autoconf-archive/ax_boost_date_time.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_BOOST_DATE_TIME
+#
+# DESCRIPTION
+#
+# Test for Date_Time library from the Boost C++ libraries. The macro
+# requires a preceding call to AX_BOOST_BASE. Further documentation is
+# available at <http://randspringer.de/boost/index.html>.
+#
+# This macro calls:
+#
+# AC_SUBST(BOOST_DATE_TIME_LIB)
+#
+# And sets:
+#
+# HAVE_BOOST_DATE_TIME
+#
+# LICENSE
+#
+# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
+# Copyright (c) 2008 Michael Tindal
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 11
+
+AC_DEFUN([AX_BOOST_DATE_TIME],
+[
+ AC_ARG_WITH([boost-date-time],
+ AS_HELP_STRING([--with-boost-date-time@<:@=special-lib@:>@],
+ [use the Date_Time library from boost - it is possible to specify a certain library for the linker
+ e.g. --with-boost-date-time=boost_date_time-gcc-mt-d-1_33_1 ]),
+ [
+ if test "$withval" = "no"; then
+ want_boost="no"
+ elif test "$withval" = "yes"; then
+ want_boost="yes"
+ ax_boost_user_date_time_lib=""
+ else
+ want_boost="yes"
+ ax_boost_user_date_time_lib="$withval"
+ fi
+ ],
+ [want_boost="yes"]
+ )
+
+ if test "x$want_boost" = "xyes"; then
+ AC_REQUIRE([AC_PROG_CC])
+ CPPFLAGS_SAVED="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+ export CPPFLAGS
+
+ LDFLAGS_SAVED="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
+ export LDFLAGS
+
+ AC_CACHE_CHECK(whether the Boost::Date_Time library is available,
+ ax_cv_boost_date_time,
+ [AC_LANG_PUSH([C++])
+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/date_time/gregorian/gregorian_types.hpp>]],
+ [[using namespace boost::gregorian; date d(2002,Jan,10);
+ return 0;
+ ]]),
+ ax_cv_boost_date_time=yes, ax_cv_boost_date_time=no)
+ AC_LANG_POP([C++])
+ ])
+ if test "x$ax_cv_boost_date_time" = "xyes"; then
+ AC_DEFINE(HAVE_BOOST_DATE_TIME,,[define if the Boost::Date_Time library is available])
+ BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
+ if test "x$ax_boost_user_date_time_lib" = "x"; then
+ for libextension in `ls $BOOSTLIBDIR/libboost_date_time*.{so,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_date_time.*\)\.so.*$;\1;' -e 's;^lib\(boost_date_time.*\)\.a*$;\1;'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_DATE_TIME_LIB="-l$ax_lib"; AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes"; break],
+ [link_date_time="no"])
+ done
+ if test "x$link_date_time" != "xyes"; then
+ for libextension in `ls $BOOSTLIBDIR/boost_date_time*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_date_time.*\)\.dll.*$;\1;' -e 's;^\(boost_date_time.*\)\.a*$;\1;'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_DATE_TIME_LIB="-l$ax_lib"; AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes"; break],
+ [link_date_time="no"])
+ done
+ fi
+
+ else
+ for ax_lib in $ax_boost_user_date_time_lib boost_date_time-$ax_boost_user_date_time_lib; do
+ AC_CHECK_LIB($ax_lib, main,
+ [BOOST_DATE_TIME_LIB="-l$ax_lib"; AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes"; break],
+ [link_date_time="no"])
+ done
+
+ fi
+ if test "x$link_date_time" != "xyes"; then
+ AC_MSG_ERROR(Could not link against $ax_lib !)
+ fi
+ fi
+
+ CPPFLAGS="$CPPFLAGS_SAVED"
+ LDFLAGS="$LDFLAGS_SAVED"
+ fi
+])
diff --git a/config/ax_boost_program_options.m4 b/config/ax_boost_program_options.m4
new file mode 100644
index 000000000..4f4d60b85
--- /dev/null
+++ b/config/ax_boost_program_options.m4
@@ -0,0 +1,105 @@
+# ===========================================================================
+# http://www.nongnu.org/autoconf-archive/ax_boost_program_options.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_BOOST_PROGRAM_OPTIONS
+#
+# DESCRIPTION
+#
+# Test for program options library from the Boost C++ libraries. The macro
+# requires a preceding call to AX_BOOST_BASE. Further documentation is
+# available at <http://randspringer.de/boost/index.html>.
+#
+# This macro calls:
+#
+# AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB)
+#
+# And sets:
+#
+# HAVE_BOOST_PROGRAM_OPTIONS
+#
+# LICENSE
+#
+# Copyright (c) 2009 Thomas Porschberg <thomas@randspringer.de>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 12
+
+AC_DEFUN([AX_BOOST_PROGRAM_OPTIONS],
+[
+ AC_ARG_WITH([boost-program-options],
+ AS_HELP_STRING([--with-boost-program-options@<:@=special-lib@:>@],
+ [use the program options library from boost - it is possible to specify a certain library for the linker
+ e.g. --with-boost-program-options=boost_program_options-gcc-mt-1_33_1 ]),
+ [
+ if test "$withval" = "no"; then
+ want_boost="no"
+ elif test "$withval" = "yes"; then
+ want_boost="yes"
+ ax_boost_user_program_options_lib=""
+ else
+ want_boost="yes"
+ ax_boost_user_program_options_lib="$withval"
+ fi
+ ],
+ [want_boost="yes"]
+ )
+
+ if test "x$want_boost" = "xyes"; then
+ AC_REQUIRE([AC_PROG_CC])
+ export want_boost
+ CPPFLAGS_SAVED="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+ export CPPFLAGS
+ LDFLAGS_SAVED="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
+ export LDFLAGS
+ AC_CACHE_CHECK([whether the Boost::Program_Options library is available],
+ ax_cv_boost_program_options,
+ [AC_LANG_PUSH(C++)
+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/program_options.hpp>
+ ]],
+ [[boost::program_options::options_description generic("Generic options");
+ return 0;]]),
+ ax_cv_boost_program_options=yes, ax_cv_boost_program_options=no)
+ AC_LANG_POP([C++])
+ ])
+ if test "$ax_cv_boost_program_options" = yes; then
+ AC_DEFINE(HAVE_BOOST_PROGRAM_OPTIONS,,[define if the Boost::PROGRAM_OPTIONS library is available])
+ BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
+ if test "x$ax_boost_user_program_options_lib" = "x"; then
+ for libextension in `ls $BOOSTLIBDIR/libboost_program_options*.so* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.so.*$;\1;'` `ls $BOOSTLIBDIR/libboost_program_options*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_program_options.*\)\.a*$;\1;'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break],
+ [link_program_options="no"])
+ done
+ if test "x$link_program_options" != "xyes"; then
+ for libextension in `ls $BOOSTLIBDIR/boost_program_options*.dll* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_program_options.*\)\.dll.*$;\1;'` `ls $BOOSTLIBDIR/boost_program_options*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_program_options.*\)\.a*$;\1;'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break],
+ [link_program_options="no"])
+ done
+ fi
+ else
+ for ax_lib in $ax_boost_user_program_options_lib boost_program_options-$ax_boost_user_program_options_lib; do
+ AC_CHECK_LIB($ax_lib, main,
+ [BOOST_PROGRAM_OPTIONS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options="yes"; break],
+ [link_program_options="no"])
+ done
+ fi
+ if test "x$link_program_options" != "xyes"; then
+ AC_MSG_ERROR([Could not link against [$ax_lib] !])
+ fi
+ fi
+ CPPFLAGS="$CPPFLAGS_SAVED"
+ LDFLAGS="$LDFLAGS_SAVED"
+ fi
+])
diff --git a/config/ax_boost_system.m4 b/config/ax_boost_system.m4
new file mode 100644
index 000000000..41f0d2c63
--- /dev/null
+++ b/config/ax_boost_system.m4
@@ -0,0 +1,117 @@
+# ===========================================================================
+# http://www.nongnu.org/autoconf-archive/ax_boost_system.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_BOOST_SYSTEM
+#
+# DESCRIPTION
+#
+# Test for System library from the Boost C++ libraries. The macro requires
+# a preceding call to AX_BOOST_BASE. Further documentation is available at
+# <http://randspringer.de/boost/index.html>.
+#
+# This macro calls:
+#
+# AC_SUBST(BOOST_SYSTEM_LIB)
+#
+# And sets:
+#
+# HAVE_BOOST_SYSTEM
+#
+# LICENSE
+#
+# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
+# Copyright (c) 2008 Michael Tindal
+# Copyright (c) 2008 Daniel Casimiro <dan.casimiro@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 6
+
+AC_DEFUN([AX_BOOST_SYSTEM],
+[
+ AC_ARG_WITH([boost-system],
+ AS_HELP_STRING([--with-boost-system@<:@=special-lib@:>@],
+ [use the System library from boost - it is possible to specify a certain library for the linker
+ e.g. --with-boost-system=boost_system-gcc-mt ]),
+ [
+ if test "$withval" = "no"; then
+ want_boost="no"
+ elif test "$withval" = "yes"; then
+ want_boost="yes"
+ ax_boost_user_system_lib=""
+ else
+ want_boost="yes"
+ ax_boost_user_system_lib="$withval"
+ fi
+ ],
+ [want_boost="yes"]
+ )
+
+ if test "x$want_boost" = "xyes"; then
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([AC_CANONICAL_BUILD])
+ CPPFLAGS_SAVED="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+ export CPPFLAGS
+
+ LDFLAGS_SAVED="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
+ export LDFLAGS
+
+ AC_CACHE_CHECK(whether the Boost::System library is available,
+ ax_cv_boost_system,
+ [AC_LANG_PUSH([C++])
+ CXXFLAGS_SAVE=$CXXFLAGS
+
+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/system/error_code.hpp>]],
+ [[boost::system::system_category]]),
+ ax_cv_boost_system=yes, ax_cv_boost_system=no)
+ CXXFLAGS=$CXXFLAGS_SAVE
+ AC_LANG_POP([C++])
+ ])
+ if test "x$ax_cv_boost_system" = "xyes"; then
+ AC_SUBST(BOOST_CPPFLAGS)
+
+ AC_DEFINE(HAVE_BOOST_SYSTEM,,[define if the Boost::System library is available])
+ BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
+
+ LDFLAGS_SAVE=$LDFLAGS
+ if test "x$ax_boost_user_system_lib" = "x"; then
+ for libextension in `ls $BOOSTLIBDIR/libboost_system*.{so,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_system.*\)\.so.*$;\1;' -e 's;^lib\(boost_system.*\)\.a*$;\1;'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break],
+ [link_system="no"])
+ done
+ if test "x$link_system" != "xyes"; then
+ for libextension in `ls $BOOSTLIBDIR/boost_system*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_system.*\)\.dll.*$;\1;' -e 's;^\(boost_system.*\)\.a*$;\1;'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break],
+ [link_system="no"])
+ done
+ fi
+
+ else
+ for ax_lib in $ax_boost_user_system_lib boost_system-$ax_boost_user_system_lib; do
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_SYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_SYSTEM_LIB) link_system="yes"; break],
+ [link_system="no"])
+ done
+
+ fi
+ if test "x$link_system" = "xno"; then
+ AC_MSG_ERROR(Could not link against $ax_lib !)
+ fi
+ fi
+
+ CPPFLAGS="$CPPFLAGS_SAVED"
+ LDFLAGS="$LDFLAGS_SAVED"
+ fi
+])
diff --git a/configure.ac b/configure.ac
index f2ccce656..925505745 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,19 +19,12 @@ LT_INIT
## Check Boost
##################################################
AC_DEFUN([UHD_CHECK_BOOST],[$1
- AC_LANG_PUSH([C++])
- AC_COMPILE_IFELSE(AC_LANG_PROGRAM(
- [[@%:@include <boost/static_assert.hpp>]],
- [[
- #ifdef $2
- BOOST_STATIC_ASSERT(true);
- #else
- BOOST_STATIC_ASSERT(false);
- #endif
- return 0;
- ]]
- ), [$3], [$4])
- AC_LANG_POP([C++])
+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([],[[
+ #ifndef $2
+ fail
+ #endif
+ return 0;
+ ]]), [$3], [$4])
])
UHD_CHECK_BOOST(
@@ -43,6 +36,18 @@ UHD_CHECK_BOOST(
[], [AC_MSG_ERROR("cannot find boost asio")]
)
UHD_CHECK_BOOST(
+ [AX_BOOST_DATE_TIME], [HAVE_BOOST_DATE_TIME],
+ [], [AC_MSG_ERROR("cannot find boost date time")]
+)
+UHD_CHECK_BOOST(
+ [AX_BOOST_PROGRAM_OPTIONS], [HAVE_BOOST_PROGRAM_OPTIONS],
+ [], [AC_MSG_ERROR("cannot find boost program options")]
+)
+UHD_CHECK_BOOST(
+ [AX_BOOST_SYSTEM], [HAVE_BOOST_SYSTEM],
+ [], [AC_MSG_ERROR("cannot find boost system")]
+)
+UHD_CHECK_BOOST(
[AX_BOOST_THREAD], [HAVE_BOOST_THREAD],
[], [AC_MSG_ERROR("cannot find boost thread")]
)
diff --git a/include/usrp_uhd/device.hpp b/include/usrp_uhd/device.hpp
index 32d58b21f..3ef4a79cf 100644
--- a/include/usrp_uhd/device.hpp
+++ b/include/usrp_uhd/device.hpp
@@ -26,9 +26,9 @@ public:
typedef boost::shared_ptr<device> sptr;
//argument types for send and recv raw methods
- //the send args is an array of buffers
- //the recv args is a callback that takes a buffer
- typedef std::vector<boost::asio::const_buffer> send_args_t;
+ //the send args is convertable to a boost asio buffer
+ //the recv args is a callback that takes a boost asio buffer
+ typedef boost::asio::const_buffer send_args_t;
typedef boost::function<bool(const boost::asio::const_buffer &)> recv_args_t;
//structors
diff --git a/include/usrp_uhd/props.hpp b/include/usrp_uhd/props.hpp
index 6e416192c..426554a53 100644
--- a/include/usrp_uhd/props.hpp
+++ b/include/usrp_uhd/props.hpp
@@ -62,7 +62,10 @@ namespace usrp_uhd{
typedef boost::tuple<wax::type, std::string> named_prop_t;
/*!
- * Possible device properties.
+ * Possible device properties:
+ * In general, a device will have a single mboard.
+ * In certain mimo applications, multiple boards
+ * will be present in the interface for configuration.
*/
enum device_prop_t{
DEVICE_PROP_NAME, //ro, std::string
@@ -71,10 +74,14 @@ namespace usrp_uhd{
};
/*!
- * Possible device mboard properties
+ * Possible device mboard properties:
+ * The general mboard properties are listed below.
+ * Custom properties can be identified with a string
+ * and discovered though the others property.
*/
enum mboard_prop_t{
MBOARD_PROP_NAME, //ro, std::string
+ MBOARD_PROP_OTHERS, //ro, prop_names_t
MBOARD_PROP_MTU, //ro, size_t
MBOARD_PROP_CLOCK_RATE, //ro, freq_t
MBOARD_PROP_RX_DSP, //ro, wax::obj
@@ -95,15 +102,16 @@ namespace usrp_uhd{
};
/*!
- * Possible device dsp properties
+ * Possible device dsp properties:
+ * A dsp can have a wide range of possible properties.
+ * A ddc would have a properties "decim", "freq", "taps"...
+ * Other properties could be gains, complex scalars, enables...
+ * For this reason the only required properties of a dsp is a name
+ * and a property to get list of other possible properties.
*/
enum dsp_prop_t{
DSP_PROP_NAME, //ro, std::string
- DSP_PROP_FREQ, //rw, freq_t
- DSP_PROP_TAPS, //rw, *_vec_t
- DSP_PROP_RATE, //rw, *_scalar_t, decim/interp
- DSP_PROP_SCALAR, //rw, *_scalar_t
- DSP_PROP_ENABLED //rw, bool or time_spec_t
+ DSP_PROP_OTHERS //ro, prop_names_t
};
/*!
@@ -117,10 +125,13 @@ namespace usrp_uhd{
};
/*!
- * Possible device codec properties
+ * Possible device codec properties:
+ * A codec is expected to have a rate and gain elements.
+ * Other properties can be discovered through the others prop.
*/
enum codec_prop_t{
CODEC_PROP_NAME, //ro, std::string
+ CODEC_PROP_OTHERS, //ro, prop_names_t
CODEC_PROP_GAIN, //rw, gain_t
CODEC_PROP_GAIN_MAX, //ro, gain_t
CODEC_PROP_GAIN_MIN, //ro, gain_t
@@ -134,6 +145,7 @@ namespace usrp_uhd{
*/
enum subdev_prop_t{
SUBDEV_PROP_NAME, //ro, std::string
+ SUBDEV_PROP_OTHERS, //ro, prop_names_t
SUBDEV_PROP_GAIN, //rw, gain_t
SUBDEV_PROP_GAIN_MAX, //ro, gain_t
SUBDEV_PROP_GAIN_MIN, //ro, gain_t
@@ -150,8 +162,7 @@ namespace usrp_uhd{
SUBDEV_PROP_SPECTRUM_INVERTED, //ro, bool
SUBDEV_PROP_IS_TX, //ro, bool
SUBDEV_PROP_RSSI, //ro, gain_t
- SUBDEV_PROP_BANDWIDTH, //rw, freq_t
- SUBDEV_PROP_CLOCK_RATE //ro, freq_t
+ SUBDEV_PROP_BANDWIDTH //rw, freq_t
};
} //namespace usrp_uhd
diff --git a/include/usrp_uhd/usrp/dboard/interface.hpp b/include/usrp_uhd/usrp/dboard/interface.hpp
index 7af45f7a2..20623ab1a 100644
--- a/include/usrp_uhd/usrp/dboard/interface.hpp
+++ b/include/usrp_uhd/usrp/dboard/interface.hpp
@@ -134,6 +134,19 @@ public:
* \return the data read if sucessful, else a zero length string.
*/
virtual std::string read_spi(spi_dev_t dev, spi_latch_t latch, size_t len) = 0;
+
+ /*!
+ * \brief Get the rate of the rx dboard clock.
+ * \return the clock rate
+ */
+ virtual double get_rx_clock_rate(void) = 0;
+
+ /*!
+ * \brief Get the rate of the tx dboard clock.
+ * \return the clock rate
+ */
+ virtual double get_tx_clock_rate(void) = 0;
+
};
}}} //namespace
diff --git a/include/usrp_uhd/utils.hpp b/include/usrp_uhd/utils.hpp
index 6fe5bd4d4..a45473ab4 100644
--- a/include/usrp_uhd/utils.hpp
+++ b/include/usrp_uhd/utils.hpp
@@ -21,6 +21,8 @@ std::vector<Key> get_map_keys(const std::map<Key, T> &m){
return v;
}
+//TODO implement a set and get gains that takes a wx obj ptr, and gain properties
+
//TODO check name in vector of names
//TODO optionally extract a name from the named_prop_t
diff --git a/lib/usrp/mboard/test.cpp b/lib/usrp/mboard/test.cpp
index cf9a5cb52..a12560e9a 100644
--- a/lib/usrp/mboard/test.cpp
+++ b/lib/usrp/mboard/test.cpp
@@ -30,6 +30,8 @@ public:
std::string read_i2c (int, size_t){return "";}
void write_spi (spi_dev_t, spi_push_t, const std::string &){}
std::string read_spi (spi_dev_t, spi_latch_t, size_t){return "";}
+ double get_rx_clock_rate(void){return 0.0;}
+ double get_tx_clock_rate(void){return 0.0;}
};
/***********************************************************************
@@ -123,6 +125,10 @@ void test::get(const wax::type &key_, wax::type &val){
val = std::string("usrp test mboard");
return;
+ case MBOARD_PROP_OTHERS:
+ val = prop_names_t(); //empty other props
+ return;
+
case MBOARD_PROP_RX_DBOARD:
if (_dboard_managers.count(name) == 0) throw std::invalid_argument(
str(boost::format("Unknown rx dboard name %s") % name)
diff --git a/test/usrp_dboard_test.cpp b/test/usrp_dboard_test.cpp
index e95068be6..d297c26ab 100644
--- a/test/usrp_dboard_test.cpp
+++ b/test/usrp_dboard_test.cpp
@@ -24,6 +24,8 @@ public:
std::string read_i2c (int, size_t){return "";}
void write_spi (spi_dev_t, spi_push_t, const std::string &){}
std::string read_spi (spi_dev_t, spi_latch_t, size_t){return "";}
+ double get_rx_clock_rate(void){return 0.0;}
+ double get_tx_clock_rate(void){return 0.0;}
};
BOOST_AUTO_TEST_CASE(test_manager){