aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/CMakeLists.txt6
-rw-r--r--host/include/uhd/convert.hpp4
-rw-r--r--host/include/uhd/device.hpp33
-rw-r--r--host/include/uhd/property_tree.hpp11
-rw-r--r--host/include/uhd/property_tree.ipp6
-rw-r--r--host/include/uhd/transport/buffer_pool.hpp4
-rw-r--r--host/include/uhd/transport/tcp_zero_copy.hpp4
-rw-r--r--host/include/uhd/transport/udp_simple.hpp4
-rw-r--r--host/include/uhd/transport/usb_control.hpp4
-rw-r--r--host/include/uhd/usrp/gps_ctrl.hpp4
-rw-r--r--host/include/uhd/usrp/multi_usrp.hpp4
-rw-r--r--host/include/uhd/usrp_clock/CMakeLists.txt23
-rw-r--r--host/include/uhd/usrp_clock/multi_usrp_clock.hpp105
-rw-r--r--host/include/uhd/usrp_clock/octoclock_eeprom.hpp61
-rw-r--r--host/include/uhd/utils/gain_group.hpp4
-rw-r--r--host/include/uhd/utils/msg_task.hpp2
-rw-r--r--host/include/uhd/version.hpp2
17 files changed, 258 insertions, 23 deletions
diff --git a/host/include/uhd/CMakeLists.txt b/host/include/uhd/CMakeLists.txt
index 2827cb826..318577b7c 100644
--- a/host/include/uhd/CMakeLists.txt
+++ b/host/include/uhd/CMakeLists.txt
@@ -1,5 +1,5 @@
-
-# Copyright 2010-2011,2013 Ettus Research LLC
+#
+# Copyright 2010-2011,2013-2014 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
@@ -15,10 +15,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-
ADD_SUBDIRECTORY(transport)
ADD_SUBDIRECTORY(types)
ADD_SUBDIRECTORY(usrp)
+ADD_SUBDIRECTORY(usrp_clock)
ADD_SUBDIRECTORY(utils)
UHD_INSTALL(FILES
diff --git a/host/include/uhd/convert.hpp b/host/include/uhd/convert.hpp
index c6b005867..6ac93fb66 100644
--- a/host/include/uhd/convert.hpp
+++ b/host/include/uhd/convert.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2011-2012 Ettus Research LLC
+// Copyright 2011-2012,2014 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
@@ -34,6 +34,8 @@ namespace uhd{ namespace convert{
typedef uhd::ref_vector<void *> output_type;
typedef uhd::ref_vector<const void *> input_type;
+ virtual ~converter(void) = 0;
+
//! Set the scale factor (used in floating point conversions)
virtual void set_scalar(const double) = 0;
diff --git a/host/include/uhd/device.hpp b/host/include/uhd/device.hpp
index b54ffc5f7..1e88a4138 100644
--- a/host/include/uhd/device.hpp
+++ b/host/include/uhd/device.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010-2011 Ettus Research LLC
+// Copyright 2010-2011,2014 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
@@ -32,8 +32,8 @@ namespace uhd{
class property_tree; //forward declaration
/*!
- * The usrp device interface represents the usrp hardware.
- * The api allows for discovery, configuration, and streaming.
+ * The device interface represents the hardware.
+ * The API allows for discovery, configuration, and streaming.
*/
class UHD_API device : boost::noncopyable{
@@ -42,6 +42,14 @@ public:
typedef boost::function<device_addrs_t(const device_addr_t &)> find_t;
typedef boost::function<sptr(const device_addr_t &)> make_t;
+ //! Device type, used as a filter in make
+ enum device_filter_t {
+ ANY,
+ USRP,
+ CLOCK
+ };
+ virtual ~device(void) = 0;
+
/*!
* Register a device into the discovery and factory system.
*
@@ -50,32 +58,35 @@ public:
*/
static void register_device(
const find_t &find,
- const make_t &make
+ const make_t &make,
+ const device_filter_t filter
);
/*!
- * \brief Find usrp devices attached to the host.
+ * \brief Find devices attached to the host.
*
* The hint device address should be used to narrow down the search
* to particular transport types and/or transport arguments.
*
* \param hint a partially (or fully) filled in device address
- * \return a vector of device addresses for all usrps on the system
+ * \param filter an optional filter to exclude USRP or clock devices
+ * \return a vector of device addresses for all devices on the system
*/
- static device_addrs_t find(const device_addr_t &hint);
+ static device_addrs_t find(const device_addr_t &hint, device_filter_t filter = ANY);
/*!
- * \brief Create a new usrp device from the device address hint.
+ * \brief Create a new device from the device address hint.
*
* The make routine will call find and pick one of the results.
* By default, the first result will be used to create a new device.
* Use the which parameter as an index into the list of results.
*
* \param hint a partially (or fully) filled in device address
+ * \param filter an optional filter to exclude USRP or clock devices
* \param which which address to use when multiple are found
* \return a shared pointer to a new device instance
*/
- static sptr make(const device_addr_t &hint, size_t which = 0);
+ static sptr make(const device_addr_t &hint, device_filter_t filter = ANY, size_t which = 0);
/*! \brief Make a new receive streamer from the streamer arguments
*
@@ -94,10 +105,14 @@ public:
//! Get access to the underlying property structure
uhd::property_tree::sptr get_tree(void) const;
+ //! Get device type
+ device_filter_t get_device_type() const;
+
#include <uhd/device_deprecated.ipp>
protected:
uhd::property_tree::sptr _tree;
+ device_filter_t _type;
};
} //namespace uhd
diff --git a/host/include/uhd/property_tree.hpp b/host/include/uhd/property_tree.hpp
index 3c24de7e6..a92654ba2 100644
--- a/host/include/uhd/property_tree.hpp
+++ b/host/include/uhd/property_tree.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2011 Ettus Research LLC
+// Copyright 2011,2014 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
@@ -36,6 +36,8 @@ public:
typedef boost::function<T(void)> publisher_type;
typedef boost::function<T(const T &)> coercer_type;
+ virtual ~property<T>(void) = 0;
+
/*!
* Register a coercer into the property.
* A coercer is a special subscriber that coerces the value.
@@ -97,6 +99,11 @@ public:
virtual bool empty(void) const = 0;
};
+template <typename T>
+property<T>::~property(void){
+ /* NOP */
+}
+
/*!
* FS Path: A glorified string with path manipulations.
* Inspired by boost filesystem path, but without the dependency.
@@ -122,6 +129,8 @@ class UHD_API property_tree : boost::noncopyable{
public:
typedef boost::shared_ptr<property_tree> sptr;
+ virtual ~property_tree(void) = 0;
+
//! Create a new + empty property tree
static sptr make(void);
diff --git a/host/include/uhd/property_tree.ipp b/host/include/uhd/property_tree.ipp
index 85720dc6b..93962c963 100644
--- a/host/include/uhd/property_tree.ipp
+++ b/host/include/uhd/property_tree.ipp
@@ -1,5 +1,5 @@
//
-// Copyright 2011 Ettus Research LLC
+// Copyright 2011,2014 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
@@ -30,6 +30,10 @@ namespace uhd{ namespace /*anon*/{
template <typename T> class property_impl : public property<T>{
public:
+ ~property_impl<T>(void){
+ /* NOP */
+ }
+
property<T> &coerce(const typename property<T>::coercer_type &coercer){
_coercer = coercer;
return *this;
diff --git a/host/include/uhd/transport/buffer_pool.hpp b/host/include/uhd/transport/buffer_pool.hpp
index 84a338097..cd2f7d1f5 100644
--- a/host/include/uhd/transport/buffer_pool.hpp
+++ b/host/include/uhd/transport/buffer_pool.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2011-2011 Ettus Research LLC
+// Copyright 2011,2014 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
@@ -33,6 +33,8 @@ namespace uhd{ namespace transport{
typedef boost::shared_ptr<buffer_pool> sptr;
typedef void * ptr_type;
+ virtual ~buffer_pool(void) = 0;
+
/*!
* Make a new buffer pool.
* \param num_buffs the number of buffers to allocate
diff --git a/host/include/uhd/transport/tcp_zero_copy.hpp b/host/include/uhd/transport/tcp_zero_copy.hpp
index a9878a396..52e94fab9 100644
--- a/host/include/uhd/transport/tcp_zero_copy.hpp
+++ b/host/include/uhd/transport/tcp_zero_copy.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010-2013 Ettus Research LLC
+// Copyright 2010-2014 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
@@ -32,6 +32,8 @@ namespace uhd{ namespace transport{
*/
struct UHD_API tcp_zero_copy : public virtual zero_copy_if
{
+ virtual ~tcp_zero_copy(void) = 0;
+
/*!
* Make a new zero copy TCP transport:
* This transport is for sending and receiving
diff --git a/host/include/uhd/transport/udp_simple.hpp b/host/include/uhd/transport/udp_simple.hpp
index ead3ad4b7..c159a95e3 100644
--- a/host/include/uhd/transport/udp_simple.hpp
+++ b/host/include/uhd/transport/udp_simple.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010 Ettus Research LLC
+// Copyright 2010,2014 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
@@ -30,6 +30,8 @@ class UHD_API udp_simple : boost::noncopyable{
public:
typedef boost::shared_ptr<udp_simple> sptr;
+ virtual ~udp_simple(void) = 0;
+
//! The maximum number of bytes per udp packet.
static const size_t mtu = 1500 - 20 - 8; //default ipv4 mtu - ipv4 header - udp header
diff --git a/host/include/uhd/transport/usb_control.hpp b/host/include/uhd/transport/usb_control.hpp
index 92b10f339..624e537ef 100644
--- a/host/include/uhd/transport/usb_control.hpp
+++ b/host/include/uhd/transport/usb_control.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010-2013 Ettus Research LLC
+// Copyright 2010-2014 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
@@ -26,6 +26,8 @@ class UHD_API usb_control : boost::noncopyable {
public:
typedef boost::shared_ptr<usb_control> sptr;
+ virtual ~usb_control(void) = 0;
+
/*!
* Create a new usb control transport:
* This transport is for sending and receiving control information from
diff --git a/host/include/uhd/usrp/gps_ctrl.hpp b/host/include/uhd/usrp/gps_ctrl.hpp
index bbccac8bb..6fda04f21 100644
--- a/host/include/uhd/usrp/gps_ctrl.hpp
+++ b/host/include/uhd/usrp/gps_ctrl.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010-2011 Ettus Research LLC
+// Copyright 2010-2011,2014 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
@@ -31,6 +31,8 @@ class UHD_API gps_ctrl : boost::noncopyable{
public:
typedef boost::shared_ptr<gps_ctrl> sptr;
+ virtual ~gps_ctrl(void) = 0;
+
/*!
* Make a GPS config for internal GPSDOs or generic NMEA GPS devices
*/
diff --git a/host/include/uhd/usrp/multi_usrp.hpp b/host/include/uhd/usrp/multi_usrp.hpp
index 883e4da3d..4c52b4506 100644
--- a/host/include/uhd/usrp/multi_usrp.hpp
+++ b/host/include/uhd/usrp/multi_usrp.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010-2012 Ettus Research LLC
+// Copyright 2010-2012,2014 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
@@ -95,6 +95,8 @@ class UHD_API multi_usrp : boost::noncopyable{
public:
typedef boost::shared_ptr<multi_usrp> sptr;
+ virtual ~multi_usrp(void) = 0;
+
//! A wildcard motherboard index
static const size_t ALL_MBOARDS = size_t(~0);
diff --git a/host/include/uhd/usrp_clock/CMakeLists.txt b/host/include/uhd/usrp_clock/CMakeLists.txt
new file mode 100644
index 000000000..7cd5aa9d3
--- /dev/null
+++ b/host/include/uhd/usrp_clock/CMakeLists.txt
@@ -0,0 +1,23 @@
+#
+# Copyright 2014 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/>.
+#
+
+UHD_INSTALL(FILES
+ octoclock_eeprom.hpp
+ multi_usrp_clock.hpp
+ DESTINATION ${INCLUDE_DIR}/uhd/octoclock
+ COMPONENT headers
+)
diff --git a/host/include/uhd/usrp_clock/multi_usrp_clock.hpp b/host/include/uhd/usrp_clock/multi_usrp_clock.hpp
new file mode 100644
index 000000000..0b50b32ae
--- /dev/null
+++ b/host/include/uhd/usrp_clock/multi_usrp_clock.hpp
@@ -0,0 +1,105 @@
+//
+// Copyright 2014 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_MULTI_USRP_CLOCK_HPP
+#define INCLUDED_UHD_MULTI_USRP_CLOCK_HPP
+
+#include <string>
+#include <vector>
+
+#include <uhd/config.hpp>
+#include <uhd/device.hpp>
+#include <uhd/types/device_addr.hpp>
+#include <uhd/types/sensors.hpp>
+
+namespace uhd{ namespace usrp_clock{
+
+/*!
+ * The Multi-USRP-Clock device class:
+ *
+ * This class facilitates ease-of-use for must use-case scenarios when
+ * using clock devices with UHD. This class can be used with a
+ * single clock device or with multiple clock devices connected to the same
+ * host.
+ *
+ * To create a multi_usrp_clock out of a single USRP Clock:
+ *
+ * <pre>
+ * device_addr_t dev;
+ * dev["addr"] = 192.168.10.3;
+ * multi_usrp_clock::sptr clock = multi_usrp_clock::make(dev);
+ * </pre>
+ *
+ * To create a multi_usrp_clock out of multiple clock devices:
+ *
+ * <pre>
+ * device_addr_t dev;
+ * dev["addr0"] = 192.168.10.3;
+ * dev["addr1"] = 192.168.10.4;
+ * multi_usrp_clock::sptr clock = multi_usrp_clock::make(dev);
+ * </pre>
+ */
+class UHD_API multi_usrp_clock : boost::noncopyable {
+public:
+ typedef boost::shared_ptr<multi_usrp_clock> sptr;
+
+ /*!
+ * Make a new Multi-USRP-Clock from the given device address.
+ * \param dev_addr the device address
+ * \return a new Multi-USRP-Clock object
+ */
+ static sptr make(const device_addr_t &dev_addr);
+
+ /*!
+ * Return the underlying device.
+ * This allows direct access to the EEPROM and sensors.
+ * \return the device object within this Multi-USRP-Clock
+ */
+ virtual device::sptr get_device(void) = 0;
+
+ /*!
+ * Get a printable summary for this USRP Clock configuration.
+ * \return a printable string
+ */
+ virtual std::string get_pp_string(void) = 0;
+
+ //! Get the number of USRP Clocks in this configuration.
+ virtual size_t get_num_boards(void) = 0;
+
+ //! Get time from device
+ virtual boost::uint32_t get_time(size_t board = 0) = 0;
+
+ /*!
+ * Get a USRP Clock sensor value.
+ * \param name the name of the sensor
+ * \param board the board index (0 to M-1)
+ * \return a sensor value object
+ */
+ virtual sensor_value_t get_sensor(const std::string &name, size_t board = 0) = 0;
+
+ /*!
+ * Get a list of possible USRP Clock sensor names.
+ * \param board the board index (0 to M-1)
+ * \return a vector of sensor names
+ */
+ virtual std::vector<std::string> get_sensor_names(size_t board = 0) = 0;
+};
+
+} //namespace
+} //namespace
+
+#endif /* INCLUDED_UHD_MULTI_USRP_CLOCK_HPP */
diff --git a/host/include/uhd/usrp_clock/octoclock_eeprom.hpp b/host/include/uhd/usrp_clock/octoclock_eeprom.hpp
new file mode 100644
index 000000000..a521000dd
--- /dev/null
+++ b/host/include/uhd/usrp_clock/octoclock_eeprom.hpp
@@ -0,0 +1,61 @@
+//
+// Copyright 2014 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_USRP_CLOCK_OCTOCLOCK_EEPROM_HPP
+#define INCLUDED_UHD_USRP_CLOCK_OCTOCLOCK_EEPROM_HPP
+
+#include <uhd/config.hpp>
+#include <uhd/transport/udp_simple.hpp>
+#include <uhd/types/dict.hpp>
+#include <string>
+
+namespace uhd{ namespace usrp_clock{
+
+/*!
+ * The OctoClock EEPROM object:
+ * Knows how to read and write the OctoClock EEPROM.
+ * The class inherits from a string, string dictionary.
+ * Use the dictionary interface to get and set values.
+ * Commit to the EEPROM to save changed settings.
+ */
+class UHD_API octoclock_eeprom_t : public uhd::dict<std::string, std::string>{
+public:
+ //! Make a new empty OctoClock EEPROM handler
+ octoclock_eeprom_t(void);
+
+ /*!
+ * Make a new OctoClock EEPROM handler.
+ * \param transport the UDP transport to the OctoClock
+ */
+ octoclock_eeprom_t(transport::udp_simple::sptr transport);
+
+ /*!
+ * Write the contents of this object to the EEPROM.
+ */
+ void commit() const;
+
+private:
+ transport::udp_simple::sptr xport;
+ void _load();
+ void _store() const;
+
+};
+
+} //namespace
+} //namespace
+
+#endif /* INCLUDED_UHD_USRP_CLOCK_OCTOCLOCK_EEPROM_HPP */
diff --git a/host/include/uhd/utils/gain_group.hpp b/host/include/uhd/utils/gain_group.hpp
index 7ef7bdcf5..56acce049 100644
--- a/host/include/uhd/utils/gain_group.hpp
+++ b/host/include/uhd/utils/gain_group.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010-2011 Ettus Research LLC
+// Copyright 2010-2011,2014 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
@@ -41,6 +41,8 @@ class UHD_API gain_group : boost::noncopyable{
public:
typedef boost::shared_ptr<gain_group> sptr;
+ virtual ~gain_group(void) = 0;
+
/*!
* Get the gain range for the gain element specified by name.
* For an empty name, get the overall gain range for this group.
diff --git a/host/include/uhd/utils/msg_task.hpp b/host/include/uhd/utils/msg_task.hpp
index 21c47a240..d46fdd69e 100644
--- a/host/include/uhd/utils/msg_task.hpp
+++ b/host/include/uhd/utils/msg_task.hpp
@@ -51,6 +51,8 @@ namespace uhd{
return std::vector<boost::uint8_t>();
}
+ virtual ~msg_task(void) = 0;
+
/*!
* Create a new task object with function callback.
* The task function callback will be run in a loop.
diff --git a/host/include/uhd/version.hpp b/host/include/uhd/version.hpp
index 81940f078..0a8347afe 100644
--- a/host/include/uhd/version.hpp
+++ b/host/include/uhd/version.hpp
@@ -27,7 +27,7 @@
* The format is oldest API compatible release - ABI compat number.
* The compatibility number allows pre-release ABI to be versioned.
*/
-#define UHD_VERSION_ABI_STRING "3.7.1-0"
+#define UHD_VERSION_ABI_STRING "3.7.2-0"
namespace uhd{