diff options
Diffstat (limited to 'gr-uhd/lib')
-rw-r--r-- | gr-uhd/lib/gr_uhd_usrp_sink.cc | 4 | ||||
-rw-r--r-- | gr-uhd/lib/gr_uhd_usrp_source.cc | 14 |
2 files changed, 11 insertions, 7 deletions
diff --git a/gr-uhd/lib/gr_uhd_usrp_sink.cc b/gr-uhd/lib/gr_uhd_usrp_sink.cc index 6c1688ea0..6216c94a8 100644 --- a/gr-uhd/lib/gr_uhd_usrp_sink.cc +++ b/gr-uhd/lib/gr_uhd_usrp_sink.cc @@ -389,8 +389,8 @@ public: else if (pmt::pmt_equal(key, TIME_KEY)){ _metadata.has_time_spec = true; _metadata.time_spec = uhd::time_spec_t( - pmt::pmt_to_uint64(pmt_tuple_ref(value, 0)), - pmt::pmt_to_double(pmt_tuple_ref(value, 1)) + pmt::pmt_to_uint64(pmt::pmt_tuple_ref(value, 0)), + pmt::pmt_to_double(pmt::pmt_tuple_ref(value, 1)) ); } } diff --git a/gr-uhd/lib/gr_uhd_usrp_source.cc b/gr-uhd/lib/gr_uhd_usrp_source.cc index ad4cb4d81..3813673b4 100644 --- a/gr-uhd/lib/gr_uhd_usrp_source.cc +++ b/gr-uhd/lib/gr_uhd_usrp_source.cc @@ -338,8 +338,8 @@ public: //If receive resulted in a timeout condition: //We now receive a single packet with a large timeout. - while (_metadata.error_code == uhd::rx_metadata_t::ERROR_CODE_TIMEOUT){ - if (boost::this_thread::interruption_requested()) return WORK_DONE; + if (_metadata.error_code == uhd::rx_metadata_t::ERROR_CODE_TIMEOUT) + { num_samps = _rx_stream->recv( output_items, noutput_items, _metadata, 0.1, true/*one pkt*/ ); @@ -377,9 +377,8 @@ public: break; case uhd::rx_metadata_t::ERROR_CODE_TIMEOUT: - //Assume that the user called stop() on the flow graph. - //However, a timeout can occur under error conditions. - return WORK_DONE; + //its ok to timeout, perhaps the user is doing finite streaming + return 0; case uhd::rx_metadata_t::ERROR_CODE_OVERFLOW: _tag_now = true; @@ -402,6 +401,11 @@ public: _stream_now = false; } + void issue_stream_cmd(const uhd::stream_cmd_t &cmd) + { + _dev->issue_stream_cmd(cmd); + } + bool start(void){ #ifdef GR_UHD_USE_STREAM_API _rx_stream = _dev->get_rx_stream(_stream_args); |