summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnathan Corgan <johnathan@corganlabs.com>2016-05-11 10:28:06 -0700
committerJohnathan Corgan <johnathan@corganlabs.com>2016-05-11 10:28:06 -0700
commit2aec2ff84b5b091d929dd03e3df688e850bdb57f (patch)
tree3001e095921bfc7069aa4c3ff008762f3e4faad6
parent5b4497b833594038deb9bbbf3779435145b6ae61 (diff)
parentf19ccc8159ee9e17eb22990dfb5834c8e6a99509 (diff)
Merge remote-tracking branch 'nwest/uhd-add-tag-cmd'
-rw-r--r--gr-uhd/lib/usrp_source_impl.cc9
-rw-r--r--gr-uhd/lib/usrp_source_impl.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/gr-uhd/lib/usrp_source_impl.cc b/gr-uhd/lib/usrp_source_impl.cc
index 7ad2280955..0a09ed34b3 100644
--- a/gr-uhd/lib/usrp_source_impl.cc
+++ b/gr-uhd/lib/usrp_source_impl.cc
@@ -31,6 +31,8 @@
namespace gr {
namespace uhd {
+ const pmt::pmt_t CMD_TAG_KEY = pmt::mp("tag");
+
usrp_source::sptr
usrp_source::make(const ::uhd::device_addr_t &device_addr,
const ::uhd::io_type_t &io_type,
@@ -80,6 +82,7 @@ namespace gr {
#ifdef GR_UHD_USE_STREAM_API
_samps_per_packet = 1;
#endif
+ register_msg_cmd_handler(CMD_TAG_KEY, boost::bind(&usrp_source_impl::_cmd_handler_tag, this, _1));
}
usrp_source_impl::~usrp_source_impl()
@@ -359,6 +362,12 @@ namespace gr {
}
void
+ usrp_source_impl::_cmd_handler_tag(const pmt::pmt_t &tag)
+ {
+ _tag_now = true;
+ }
+
+ void
usrp_source_impl::set_start_time(const ::uhd::time_spec_t &time)
{
_start_time = time;
diff --git a/gr-uhd/lib/usrp_source_impl.h b/gr-uhd/lib/usrp_source_impl.h
index b43df4dab3..78a8341a5a 100644
--- a/gr-uhd/lib/usrp_source_impl.h
+++ b/gr-uhd/lib/usrp_source_impl.h
@@ -112,6 +112,7 @@ namespace gr {
private:
//! Like set_center_freq(), but uses _curr_freq and _curr_lo_offset
::uhd::tune_result_t _set_center_freq_from_internals(size_t chan);
+ void _cmd_handler_tag(const pmt::pmt_t &tag);
#ifdef GR_UHD_USE_STREAM_API
::uhd::rx_streamer::sptr _rx_stream;