aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/device.hpp10
-rw-r--r--host/include/uhd/device_deprecated.ipp10
-rw-r--r--host/include/uhd/exception.hpp4
-rw-r--r--host/include/uhd/stream.hpp30
-rw-r--r--host/include/uhd/transport/bounded_buffer.ipp6
-rw-r--r--host/include/uhd/transport/usb_control.hpp6
-rw-r--r--host/include/uhd/transport/usb_device_handle.hpp18
-rw-r--r--host/include/uhd/transport/usb_zero_copy.hpp20
-rw-r--r--host/include/uhd/transport/vrt_if_packet.hpp43
-rw-r--r--host/include/uhd/types/serial.hpp23
-rw-r--r--host/include/uhd/types/tune_request.hpp15
-rw-r--r--host/include/uhd/usrp/dboard_iface.hpp4
-rw-r--r--host/include/uhd/utils/msg.hpp7
-rw-r--r--host/include/uhd/utils/paths.hpp4
-rw-r--r--host/include/uhd/version.hpp4
15 files changed, 144 insertions, 60 deletions
diff --git a/host/include/uhd/device.hpp b/host/include/uhd/device.hpp
index 89c6332da..de39383c9 100644
--- a/host/include/uhd/device.hpp
+++ b/host/include/uhd/device.hpp
@@ -82,16 +82,6 @@ public:
//! Make a new transmit streamer from the streamer arguments
virtual tx_streamer::sptr get_tx_stream(const stream_args_t &args) = 0;
- /*!
- * Receive and asynchronous message from the device.
- * \param async_metadata the metadata to be filled in
- * \param timeout the timeout in seconds to wait for a message
- * \return true when the async_metadata is valid, false for timeout
- */
- virtual bool recv_async_msg(
- async_metadata_t &async_metadata, double timeout = 0.1
- ) = 0;
-
//! Get access to the underlying property structure
virtual boost::shared_ptr<property_tree> get_tree(void) const = 0;
diff --git a/host/include/uhd/device_deprecated.ipp b/host/include/uhd/device_deprecated.ipp
index 0ee1cd706..58c43a876 100644
--- a/host/include/uhd/device_deprecated.ipp
+++ b/host/include/uhd/device_deprecated.ipp
@@ -184,6 +184,16 @@ size_t get_max_recv_samps_per_packet(void){
return _rx_streamer->get_max_num_samps();
}
+/*!
+ * Receive and asynchronous message from the device.
+ * \param async_metadata the metadata to be filled in
+ * \param timeout the timeout in seconds to wait for a message
+ * \return true when the async_metadata is valid, false for timeout
+ */
+virtual bool recv_async_msg(
+ async_metadata_t &async_metadata, double timeout = 0.1
+) = 0;
+
private:
rx_streamer::sptr _rx_streamer;
io_type_t::tid_t _recv_tid;
diff --git a/host/include/uhd/exception.hpp b/host/include/uhd/exception.hpp
index c05861788..69e902fd5 100644
--- a/host/include/uhd/exception.hpp
+++ b/host/include/uhd/exception.hpp
@@ -157,9 +157,9 @@ namespace uhd{
* If the code evaluates to false, throw an assertion error.
* \param code the code that resolved to a boolean
*/
- #define UHD_ASSERT_THROW(code) if (not (code)) \
+ #define UHD_ASSERT_THROW(code) {if (not (code)) \
throw uhd::assertion_error(UHD_THROW_SITE_INFO(#code)); \
- else void(0)
+ }
} //namespace uhd
diff --git a/host/include/uhd/stream.hpp b/host/include/uhd/stream.hpp
index c8ab303ad..75b097ded 100644
--- a/host/include/uhd/stream.hpp
+++ b/host/include/uhd/stream.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2011-2012 Ettus Research LLC
+// Copyright 2011-2013 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
@@ -21,6 +21,7 @@
#include <uhd/config.hpp>
#include <uhd/types/metadata.hpp>
#include <uhd/types/device_addr.hpp>
+#include <uhd/types/stream_cmd.hpp>
#include <uhd/types/ref_vector.hpp>
#include <boost/utility.hpp>
#include <boost/shared_ptr.hpp>
@@ -124,6 +125,8 @@ class UHD_API rx_streamer : boost::noncopyable{
public:
typedef boost::shared_ptr<rx_streamer> sptr;
+ virtual ~rx_streamer(void);
+
//! Get the number of channels associated with this streamer
virtual size_t get_num_channels(void) const = 0;
@@ -170,6 +173,19 @@ public:
const double timeout = 0.1,
const bool one_packet = false
) = 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.
+ *
+ * With multiple devices, the first stream command in a chain of commands
+ * should have a time spec in the near future and stream_now = false;
+ * to ensure that the packets can be aligned by their time specs.
+ *
+ * \param stream_cmd the stream command to issue
+ */
+ virtual void issue_stream_cmd(const stream_cmd_t &stream_cmd) = 0;
};
/*!
@@ -181,6 +197,8 @@ class UHD_API tx_streamer : boost::noncopyable{
public:
typedef boost::shared_ptr<tx_streamer> sptr;
+ virtual ~tx_streamer(void);
+
//! Get the number of channels associated with this streamer
virtual size_t get_num_channels(void) const = 0;
@@ -217,6 +235,16 @@ public:
const tx_metadata_t &metadata,
const double timeout = 0.1
) = 0;
+
+ /*!
+ * Receive and asynchronous message from this TX stream.
+ * \param async_metadata the metadata to be filled in
+ * \param timeout the timeout in seconds to wait for a message
+ * \return true when the async_metadata is valid, false for timeout
+ */
+ virtual bool recv_async_msg(
+ async_metadata_t &async_metadata, double timeout = 0.1
+ ) = 0;
};
} //namespace uhd
diff --git a/host/include/uhd/transport/bounded_buffer.ipp b/host/include/uhd/transport/bounded_buffer.ipp
index 9c24005b7..35ffb293b 100644
--- a/host/include/uhd/transport/bounded_buffer.ipp
+++ b/host/include/uhd/transport/bounded_buffer.ipp
@@ -1,5 +1,5 @@
//
-// Copyright 2010-2011 Ettus Research LLC
+// Copyright 2010-2013 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,7 +26,7 @@
#include <boost/thread/condition.hpp>
#include <boost/thread/locks.hpp>
-namespace uhd{ namespace transport{ namespace{ /*anon*/
+namespace uhd{ namespace transport{
template <typename elem_type> class bounded_buffer_detail : boost::noncopyable{
public:
@@ -142,6 +142,6 @@ namespace uhd{ namespace transport{ namespace{ /*anon*/
}
};
-}}} //namespace
+}} //namespace
#endif /* INCLUDED_UHD_TRANSPORT_BOUNDED_BUFFER_IPP */
diff --git a/host/include/uhd/transport/usb_control.hpp b/host/include/uhd/transport/usb_control.hpp
index 2af4b3bbe..92b10f339 100644
--- a/host/include/uhd/transport/usb_control.hpp
+++ b/host/include/uhd/transport/usb_control.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010 Ettus Research LLC
+// Copyright 2010-2013 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
@@ -51,6 +51,7 @@ public:
* \param index 2-byte (wIndex)
* \param buff buffer to hold send or receive data
* \param length 2-byte (wLength)
+ * \param timeout 4-byte (timeout, default is infinite wait)
* \return number of bytes submitted or error code
*/
virtual ssize_t submit(boost::uint8_t request_type,
@@ -58,7 +59,8 @@ public:
boost::uint16_t value,
boost::uint16_t index,
unsigned char *buff,
- boost::uint16_t length) = 0;
+ boost::uint16_t length,
+ boost::int32_t timeout = 0) = 0;
};
}} //namespace
diff --git a/host/include/uhd/transport/usb_device_handle.hpp b/host/include/uhd/transport/usb_device_handle.hpp
index 6f8d868be..2951d7fbb 100644
--- a/host/include/uhd/transport/usb_device_handle.hpp
+++ b/host/include/uhd/transport/usb_device_handle.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010 Ettus Research LLC
+// Copyright 2010-2013 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
@@ -43,12 +43,24 @@ public:
typedef boost::shared_ptr<usb_device_handle> sptr;
/*!
- * Return the device's serial number
+ * Return the device's serial number
* \return a string describing the device's serial number
*/
virtual std::string get_serial() const = 0;
/*!
+ * Return the device's manufacturer identification string
+ * \return a string describing the device's manufacturer string
+ */
+ virtual std::string get_manufacturer() const = 0;
+
+ /*!
+ * Return the device's product identification string
+ * \return a string describing the device's product string
+ */
+ virtual std::string get_product() const = 0;
+
+ /*!
* Return the device's Vendor ID (usually assigned by the USB-IF)
* \return a Vendor ID
*/
@@ -61,7 +73,7 @@ public:
virtual boost::uint16_t get_product_id() const = 0;
/*!
- * Return a vector of USB devices on this host
+ * Return a vector of USB devices on this host
* \return a vector of USB device handles that match vid and pid
*/
static std::vector<usb_device_handle::sptr> get_device_list(boost::uint16_t vid, boost::uint16_t pid);
diff --git a/host/include/uhd/transport/usb_zero_copy.hpp b/host/include/uhd/transport/usb_zero_copy.hpp
index 24b709ec9..3990568c3 100644
--- a/host/include/uhd/transport/usb_zero_copy.hpp
+++ b/host/include/uhd/transport/usb_zero_copy.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010-2011 Ettus Research LLC
+// Copyright 2010-2013 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
@@ -61,24 +61,6 @@ public:
const size_t send_endpoint,
const device_addr_t &hints = device_addr_t()
);
-
- /*!
- * Make a wrapper around a zero copy implementation.
- * The wrapper performs the following functions:
- * - Pad commits to the frame boundary
- * - Extract multiple packets on recv
- *
- * When enable multiple receive packets is set to true,
- * the implementation inspects the vita length on transfers,
- * and may split a single transfer into multiple managed buffers.
- *
- * \param usb_zc a usb zero copy interface object
- * \param usb_frame_boundary bytes per frame
- * \return a new zero copy wrapper object
- */
- static sptr make_wrapper(
- sptr usb_zc, size_t usb_frame_boundary = 512
- );
};
}} //namespace
diff --git a/host/include/uhd/transport/vrt_if_packet.hpp b/host/include/uhd/transport/vrt_if_packet.hpp
index 1be480874..d16892281 100644
--- a/host/include/uhd/transport/vrt_if_packet.hpp
+++ b/host/include/uhd/transport/vrt_if_packet.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010 Ettus Research LLC
+// Copyright 2010-2013 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,9 @@ namespace uhd{ namespace transport{
namespace vrt{
+ //! The maximum number of 32-bit words in the vrlp link layer
+ static const size_t num_vrl_words32 = 3;
+
//! The maximum number of 32-bit words in a vrt if packet header
static const size_t max_if_hdr_words32 = 7; //hdr+sid+cid+tsi+tsf
@@ -34,12 +37,24 @@ namespace vrt{
* The size fields are used for input and output depending upon
* the operation used (ie the pack or unpack function call).
*/
- struct UHD_API if_packet_info_t{
- //packet type (pack only supports data)
- enum packet_type_t {
+ struct UHD_API if_packet_info_t
+ {
+ if_packet_info_t(void);
+
+ //link layer type - always set for pack and unpack
+ enum link_type_t
+ {
+ LINK_TYPE_NONE = 0x0,
+ LINK_TYPE_CHDR = 0x1,
+ LINK_TYPE_VRLP = 0x2,
+ } link_type;
+
+ //packet type
+ enum packet_type_t
+ {
PACKET_TYPE_DATA = 0x0,
- PACKET_TYPE_EXTENSION = 0x1,
- PACKET_TYPE_CONTEXT = 0x2
+ PACKET_TYPE_IF_EXT = 0x1,
+ PACKET_TYPE_CONTEXT = 0x2, //extension context: has_sid = true
} packet_type;
//size fields
@@ -100,6 +115,22 @@ namespace vrt{
if_packet_info_t &if_packet_info
);
+ UHD_INLINE if_packet_info_t::if_packet_info_t(void):
+ link_type(LINK_TYPE_NONE),
+ packet_type(PACKET_TYPE_DATA),
+ num_payload_words32(0),
+ num_payload_bytes(0),
+ num_header_words32(0),
+ num_packet_words32(0),
+ packet_count(0),
+ sob(false), eob(false),
+ has_sid(false), sid(0),
+ has_cid(false), cid(0),
+ has_tsi(false), tsi(0),
+ has_tsf(false), tsf(0),
+ has_tlr(false), tlr(0)
+ {}
+
} //namespace vrt
}} //namespace
diff --git a/host/include/uhd/types/serial.hpp b/host/include/uhd/types/serial.hpp
index f66822775..7b565c633 100644
--- a/host/include/uhd/types/serial.hpp
+++ b/host/include/uhd/types/serial.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010-2011 Ettus Research LLC
+// Copyright 2010-2013 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
@@ -46,13 +46,18 @@ namespace uhd{
public:
typedef boost::shared_ptr<i2c_iface> sptr;
+ virtual ~i2c_iface(void);
+
+ //! Create an i2c_iface than can talk to 16 bit addressable EEPROMS
+ i2c_iface::sptr eeprom16(void);
+
/*!
* Write bytes over the i2c.
* \param addr the address
* \param buf the vector of bytes
*/
virtual void write_i2c(
- boost::uint8_t addr,
+ boost::uint16_t addr,
const byte_vector_t &buf
) = 0;
@@ -63,7 +68,7 @@ namespace uhd{
* \return a vector of bytes
*/
virtual byte_vector_t read_i2c(
- boost::uint8_t addr,
+ boost::uint16_t addr,
size_t num_bytes
) = 0;
@@ -74,8 +79,8 @@ namespace uhd{
* \param buf the vector of bytes
*/
virtual void write_eeprom(
- boost::uint8_t addr,
- boost::uint8_t offset,
+ boost::uint16_t addr,
+ boost::uint16_t offset,
const byte_vector_t &buf
);
@@ -87,8 +92,8 @@ namespace uhd{
* \return a vector of bytes
*/
virtual byte_vector_t read_eeprom(
- boost::uint8_t addr,
- boost::uint8_t offset,
+ boost::uint16_t addr,
+ boost::uint16_t offset,
size_t num_bytes
);
};
@@ -128,6 +133,8 @@ namespace uhd{
public:
typedef boost::shared_ptr<spi_iface> sptr;
+ virtual ~spi_iface(void);
+
/*!
* Perform a spi transaction.
* \param which_slave the slave device number
@@ -182,6 +189,8 @@ namespace uhd{
public:
typedef boost::shared_ptr<uart_iface> sptr;
+ virtual ~uart_iface(void);
+
/*!
* Write to a serial port.
* \param buf the data to write
diff --git a/host/include/uhd/types/tune_request.hpp b/host/include/uhd/types/tune_request.hpp
index 9c498bfe9..dd6123a9f 100644
--- a/host/include/uhd/types/tune_request.hpp
+++ b/host/include/uhd/types/tune_request.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010 Ettus Research LLC
+// Copyright 2010-2012 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_TUNE_REQUEST_HPP
#include <uhd/config.hpp>
+#include <uhd/types/device_addr.hpp>
namespace uhd{
@@ -88,6 +89,18 @@ namespace uhd{
*/
double dsp_freq;
+ /*!
+ * The args parameter is used to pass arbitrary key/value pairs.
+ * Possible keys used by args (depends on implementation):
+ *
+ * - mode_n: Allows the user to tell the daughterboard tune code
+ * to choose between an integer N diviver or fractional N divider.
+ * Default is fractional N on boards that support fractional N tuning.
+ * Fractional N provides greater tuning acuracy at the expense of spurs.
+ * Possible options for this key: "integer" or "fractional".
+ */
+ device_addr_t args;
+
};
} //namespace uhd
diff --git a/host/include/uhd/usrp/dboard_iface.hpp b/host/include/uhd/usrp/dboard_iface.hpp
index 6a6a68321..b0f92e2ab 100644
--- a/host/include/uhd/usrp/dboard_iface.hpp
+++ b/host/include/uhd/usrp/dboard_iface.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010-2011 Ettus Research LLC
+// Copyright 2010-2013 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
@@ -290,6 +290,8 @@ private:
protected:
dboard_iface(void);
+public:
+ virtual ~dboard_iface(void);
};
diff --git a/host/include/uhd/utils/msg.hpp b/host/include/uhd/utils/msg.hpp
index 3aac9577a..2cc5893e7 100644
--- a/host/include/uhd/utils/msg.hpp
+++ b/host/include/uhd/utils/msg.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2011 Ettus Research LLC
+// Copyright 2011-2013 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
@@ -21,6 +21,7 @@
#include <uhd/config.hpp>
#include <uhd/utils/pimpl.hpp>
#include <ostream>
+#include <iomanip>
#include <string>
/*!
@@ -38,6 +39,10 @@
#define UHD_VAR(var) \
UHD_MSG(status) << #var << " = " << var << std::endl;
+//! Helpful debug tool to print a variable in hex
+#define UHD_HEX(var) \
+ UHD_MSG(status) << #var << " = 0x" << std::hex << std::setfill('0') << std::setw(8) << var << std::dec << std::endl;
+
namespace uhd{ namespace msg{
//! Possible message types
diff --git a/host/include/uhd/utils/paths.hpp b/host/include/uhd/utils/paths.hpp
index f5a40b2c9..e0f455e92 100644
--- a/host/include/uhd/utils/paths.hpp
+++ b/host/include/uhd/utils/paths.hpp
@@ -29,8 +29,8 @@ namespace uhd{
//! Get a string representing the system's appdata directory
UHD_API std::string get_app_path(void);
- //! Get a string representing the system's pkg data directory
- UHD_API std::string get_pkg_data_path(void);
+ //! Get a string representing the system's pkg directory
+ UHD_API std::string get_pkg_path(void);
} //namespace uhd
diff --git a/host/include/uhd/version.hpp b/host/include/uhd/version.hpp
index ab693f2b0..a62ee8285 100644
--- a/host/include/uhd/version.hpp
+++ b/host/include/uhd/version.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010-2012 Ettus Research LLC
+// Copyright 2010-2013 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
@@ -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.4.0-3"
+#define UHD_VERSION_ABI_STRING "3.6.0-1"
namespace uhd{