summaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/types/device_addr.hpp20
-rw-r--r--host/include/uhd/usrp/simple_usrp.hpp47
2 files changed, 57 insertions, 10 deletions
diff --git a/host/include/uhd/types/device_addr.hpp b/host/include/uhd/types/device_addr.hpp
index f5dd9371c..e8da2a1ab 100644
--- a/host/include/uhd/types/device_addr.hpp
+++ b/host/include/uhd/types/device_addr.hpp
@@ -32,13 +32,23 @@ namespace uhd{
*
* To narrow down the discovery process to a particular device,
* specify a transport key/value pair specific to your device.
- * Ex, to find a usrp2: my_dev_addr["addr"] = [resolvable_hostname_or_ip]
+ * - Ex, to find a usrp2: my_dev_addr["addr"] = [resolvable_hostname_or_ip]
*
* The device address can also be used to pass arguments into
* the transport layer control to set (for example) buffer sizes.
+ *
+ * An arguments string, is a way to represent a device address
+ * using a single string with delimiter characters.
+ * - Ex: addr=192.168.10.2
+ * - Ex: addr=192.168.10.2, rx_buff_size=1e6
*/
class UHD_API device_addr_t : public dict<std::string, std::string>{
public:
+ /*!
+ * Create a device address from an args string.
+ * \param args the arguments string
+ */
+ device_addr_t(const std::string &args = "");
/*!
* Convert a device address into a printable string.
@@ -52,14 +62,6 @@ namespace uhd{
* \return a string with delimiter markup
*/
std::string to_args_str(void) const;
-
- /*!
- * Make a device address from an args string.
- * The args string contains delimiter symbols.
- * \param args_str the arguments string
- * \return the new device address
- */
- static device_addr_t from_args_str(const std::string &args_str);
};
//handy typedef for a vector of device addresses
diff --git a/host/include/uhd/usrp/simple_usrp.hpp b/host/include/uhd/usrp/simple_usrp.hpp
index c4e0338f7..e3f181ec3 100644
--- a/host/include/uhd/usrp/simple_usrp.hpp
+++ b/host/include/uhd/usrp/simple_usrp.hpp
@@ -39,18 +39,63 @@ namespace uhd{ namespace usrp{
class UHD_API simple_usrp : boost::noncopyable{
public:
typedef boost::shared_ptr<simple_usrp> sptr;
- static sptr make(const std::string &args);
+ /*!
+ * Make a new simple usrp from the device address.
+ * \param dev_addr the device address
+ * \return a new simple usrp object
+ */
+ static sptr make(const device_addr_t &dev_addr);
+
+ /*!
+ * Get the underlying device object.
+ * This is needed to get access to the streaming API and properties.
+ * \return the device object within this simple usrp
+ */
virtual device::sptr get_device(void) = 0;
+ /*!
+ * Get a printable name for this simple usrp.
+ * \return a printable string
+ */
virtual std::string get_name(void) = 0;
/*******************************************************************
* Misc
******************************************************************/
+ /*!
+ * Sets the time registers on the usrp immediately.
+ * \param time_spec the time to latch into the usrp device
+ */
virtual void set_time_now(const time_spec_t &time_spec) = 0;
+
+ /*!
+ * Set the time registers on the usrp at the next pps tick.
+ * The values will not be latched in until the pulse occurs.
+ * It is recommended that the user sleep(1) after calling to ensure
+ * that the time registers will be in a known state prior to use.
+ *
+ * Note: Because this call sets the time on the "next" pps,
+ * the seconds in the time spec should be current seconds + 1.
+ *
+ * \param time_spec the time to latch into the usrp device
+ */
virtual void set_time_next_pps(const time_spec_t &time_spec) = 0;
+
+ /*!
+ * Issue a stream command to the usrp device.
+ * This tells the usrp to send samples into the host.
+ * See the documentation for stream_cmd_t for more info.
+ * \param stream_cmd the stream command to issue
+ */
virtual void issue_stream_cmd(const stream_cmd_t &stream_cmd) = 0;
+
+ /*!
+ * Set the clock configuration for the usrp device.
+ * This tells the usrp how to get a 10Mhz reference and PPS clock.
+ * See the documentation for clock_config_t for more info.
+ * \param clock_config the clock configuration to set
+ */
virtual void set_clock_config(const clock_config_t &clock_config) = 0;
/*******************************************************************