diff options
author | Josh Blum <josh@joshknows.com> | 2010-07-20 16:58:33 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-07-20 16:58:33 -0700 |
commit | 8e29df8b3176d966ba2b987f0bbaea108ba8135c (patch) | |
tree | 6d142c308ea0c197a464a93a6a7fbd3d0d1f5ab2 /host/include | |
parent | 20381a1c839ded4eb58728d3a1fd3a952d2444f6 (diff) | |
parent | 5a4545d3f9689dcddd88f9316ad7bd9c489a3925 (diff) | |
download | uhd-8e29df8b3176d966ba2b987f0bbaea108ba8135c.tar.gz uhd-8e29df8b3176d966ba2b987f0bbaea108ba8135c.tar.bz2 uhd-8e29df8b3176d966ba2b987f0bbaea108ba8135c.zip |
Merge branch 'master' into tx_report
Diffstat (limited to 'host/include')
-rw-r--r-- | host/include/uhd/device.hpp | 10 | ||||
-rw-r--r-- | host/include/uhd/device.ipp | 5 |
2 files changed, 11 insertions, 4 deletions
diff --git a/host/include/uhd/device.hpp b/host/include/uhd/device.hpp index a19d22880..ee297ec8a 100644 --- a/host/include/uhd/device.hpp +++ b/host/include/uhd/device.hpp @@ -42,6 +42,9 @@ public: typedef boost::function<device_addrs_t(const device_addr_t &)> find_t; typedef boost::function<sptr(const device_addr_t &)> make_t; + //! A reasonable default timeout for receive + static const size_t default_recv_timeout_ms = 100; + /*! * Register a device into the discovery and factory system. * @@ -174,6 +177,7 @@ public: * \param metadata data to fill describing the buffer * \param io_type the type of data to fill into the buffer * \param recv_mode tells recv how to load the buffer + * \param timeout_ms the timeout in milliseconds to wait for a packet * \return the number of samples received or 0 on error */ virtual size_t recv( @@ -181,7 +185,8 @@ public: size_t nsamps_per_buff, rx_metadata_t &metadata, const io_type_t &io_type, - recv_mode_t recv_mode + recv_mode_t recv_mode, + size_t timeout_ms = default_recv_timeout_ms ) = 0; /*! @@ -192,7 +197,8 @@ public: size_t nsamps_per_buff, rx_metadata_t &metadata, const io_type_t &io_type, - recv_mode_t recv_mode + recv_mode_t recv_mode, + size_t timeout_ms = default_recv_timeout_ms ); //! Deprecated diff --git a/host/include/uhd/device.ipp b/host/include/uhd/device.ipp index c38a2e43e..603c52859 100644 --- a/host/include/uhd/device.ipp +++ b/host/include/uhd/device.ipp @@ -52,12 +52,13 @@ namespace uhd{ size_t nsamps_per_buff, rx_metadata_t &metadata, const io_type_t &io_type, - recv_mode_t recv_mode + recv_mode_t recv_mode, + size_t timeout_ms ){ return this->recv( std::vector<void *>(1, buff), nsamps_per_buff, metadata, - io_type, recv_mode + io_type, recv_mode, timeout_ms ); } |