summaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-03-04 18:34:28 -0800
committerJosh Blum <josh@joshknows.com>2010-03-04 18:34:28 -0800
commitbb86022d5a5f7055cdeebaeb4a55216e1a056fd4 (patch)
tree8dd96e7b0fcef00fde57da97d44e012cc6177670 /host/include
parent821c31417894bed5603dc1a18415d4a35ddd7c2d (diff)
downloaduhd-bb86022d5a5f7055cdeebaeb4a55216e1a056fd4.tar.gz
uhd-bb86022d5a5f7055cdeebaeb4a55216e1a056fd4.tar.bz2
uhd-bb86022d5a5f7055cdeebaeb4a55216e1a056fd4.zip
Moved timeouts into the udp transports.
Simplified the fast path checking in the fw, but it turns out this was not the issue. Fixed some bad bit operations with the 16sc words (dont forget sign extension). Added some more documentation to the headers....
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/device.hpp11
-rw-r--r--host/include/uhd/transport/udp_simple.hpp4
-rw-r--r--host/include/uhd/transport/udp_zero_copy.hpp4
3 files changed, 15 insertions, 4 deletions
diff --git a/host/include/uhd/device.hpp b/host/include/uhd/device.hpp
index 1a52867c9..47dfa4328 100644
--- a/host/include/uhd/device.hpp
+++ b/host/include/uhd/device.hpp
@@ -77,6 +77,9 @@ public:
* It is up to the caller to call send again on the un-sent
* portions of the buffer, until the buffer is exhausted.
*
+ * This is a blocking call and will not return until the number
+ * of samples returned have been read out of the buffer.
+ *
* \param buff a buffer pointing to some read-only memory
* \param metadata data describing the buffer's contents
* \param the type of data loaded in the buffer (32fc, 16sc)
@@ -101,6 +104,14 @@ public:
* The next call to receive, after the remainder becomes exahausted,
* will perform an over-the-wire receive as usual.
*
+ * This is a blocking call and will not return until the number
+ * of samples returned have been written into the buffer.
+ * However, a call to receive may timeout and return zero samples.
+ * The timeout duration is decided by the underlying transport layer.
+ * The caller should assume that the call to receive will not return
+ * immediately when no packets are available to the transport layer,
+ * and that the timeout duration is reasonably tuned for performance.
+ *
* \param buff the buffer to fill with IF data
* \param metadata data to fill describing the buffer
* \param the type of data to fill into the buffer (32fc, 16sc)
diff --git a/host/include/uhd/transport/udp_simple.hpp b/host/include/uhd/transport/udp_simple.hpp
index 8663128ec..0d8fcc5f0 100644
--- a/host/include/uhd/transport/udp_simple.hpp
+++ b/host/include/uhd/transport/udp_simple.hpp
@@ -67,9 +67,9 @@ public:
/*!
* Receive into the provided buffer.
- * Returns empty when data is not available.
+ * Blocks until data is received or a timeout occurs.
* \param buff a mutable buffer to receive into
- * \return the number of bytes received.
+ * \return the number of bytes received or zero on timeout
*/
virtual size_t recv(const boost::asio::mutable_buffer &buff) = 0;
};
diff --git a/host/include/uhd/transport/udp_zero_copy.hpp b/host/include/uhd/transport/udp_zero_copy.hpp
index 9c3505dd6..1a8d822fd 100644
--- a/host/include/uhd/transport/udp_zero_copy.hpp
+++ b/host/include/uhd/transport/udp_zero_copy.hpp
@@ -64,9 +64,9 @@ public:
/*!
* Receive a buffer.
+ * Blocks until data is received or a timeout occurs.
* The memory is managed by the implementation.
- * Returns an empty buffer when data is not available.
- * \return a smart buffer with memory and size
+ * \return a smart buffer (empty on timeout)
*/
virtual smart_buffer::sptr recv(void) = 0;
};