From ccf1d5c5e5f5c20ff77f45da3295b9dd5bdb6272 Mon Sep 17 00:00:00 2001 From: michael-west Date: Thu, 2 Apr 2015 10:51:27 -0700 Subject: uhd: Add ability to get and set command time through dboard_iface. This creates a wb_iface child class called timed_wb_iface, which adds support for timed commands. --- host/include/uhd/types/wb_iface.hpp | 20 +++++++++++++++++++- host/include/uhd/usrp/dboard_iface.hpp | 13 +++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) (limited to 'host/include') diff --git a/host/include/uhd/types/wb_iface.hpp b/host/include/uhd/types/wb_iface.hpp index c508062e4..e24e9363e 100644 --- a/host/include/uhd/types/wb_iface.hpp +++ b/host/include/uhd/types/wb_iface.hpp @@ -1,5 +1,5 @@ // -// Copyright 2011-2013 Ettus Research LLC +// Copyright 2011-2013,2015 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 @@ -19,6 +19,7 @@ #define INCLUDED_UHD_TYPES_WB_IFACE_HPP #include +#include #include #include @@ -74,7 +75,24 @@ public: * \return the 16bit data */ virtual boost::uint16_t peek16(const wb_addr_type addr); +}; +class UHD_API timed_wb_iface : public wb_iface +{ +public: + typedef boost::shared_ptr sptr; + + /*! + * Get the command time. + * \return the command time + */ + virtual time_spec_t get_time(void) = 0; + + /*! + * Set the command time. + * \param t the command time + */ + virtual void set_time(const time_spec_t& t) = 0; }; } //namespace uhd diff --git a/host/include/uhd/usrp/dboard_iface.hpp b/host/include/uhd/usrp/dboard_iface.hpp index b0f92e2ab..f8f318a40 100644 --- a/host/include/uhd/usrp/dboard_iface.hpp +++ b/host/include/uhd/usrp/dboard_iface.hpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -280,6 +281,18 @@ public: */ virtual double get_codec_rate(unit_t unit) = 0; + /*! + * Get the command time. + * \return the command time + */ + virtual uhd::time_spec_t get_command_time(void); + + /*! + * Set the command time. + * \param t the time + */ + virtual void set_command_time(const uhd::time_spec_t& t); + private: UHD_PIMPL_DECL(impl) _impl; -- cgit v1.2.3