summaryrefslogtreecommitdiff
path: root/gr-uhd
diff options
context:
space:
mode:
Diffstat (limited to 'gr-uhd')
-rw-r--r--gr-uhd/include/gr_uhd_usrp_source.h13
-rw-r--r--gr-uhd/lib/gr_uhd_usrp_source.cc5
-rw-r--r--gr-uhd/swig/uhd_swig.i2
3 files changed, 20 insertions, 0 deletions
diff --git a/gr-uhd/include/gr_uhd_usrp_source.h b/gr-uhd/include/gr_uhd_usrp_source.h
index b5acabee4..1243ddcc2 100644
--- a/gr-uhd/include/gr_uhd_usrp_source.h
+++ b/gr-uhd/include/gr_uhd_usrp_source.h
@@ -129,6 +129,19 @@ public:
virtual void set_start_time(const uhd::time_spec_t &time) = 0;
/*!
+ * *Advanced use only:*
+ * Issue a stream command to all channels in this source block.
+ *
+ * This method is intended to override the default "always on" behavior.
+ * After starting the flow graph, the user should call stop() on this block,
+ * then issue any desired arbitrary stream_cmd_t structs to the device.
+ * The USRP will be able to enqueue several stream commands in the FPGA.
+ *
+ * \param cmd the stream command to issue to all source channels
+ */
+ virtual void issue_stream_cmd(const uhd::stream_cmd_t &cmd) = 0;
+
+ /*!
* Returns identifying information about this USRP's configuration.
* Returns motherboard ID, name, and serial.
* Returns daughterboard RX ID, subdev name and spec, serial, and antenna.
diff --git a/gr-uhd/lib/gr_uhd_usrp_source.cc b/gr-uhd/lib/gr_uhd_usrp_source.cc
index ad4cb4d81..139caf9dd 100644
--- a/gr-uhd/lib/gr_uhd_usrp_source.cc
+++ b/gr-uhd/lib/gr_uhd_usrp_source.cc
@@ -402,6 +402,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);
diff --git a/gr-uhd/swig/uhd_swig.i b/gr-uhd/swig/uhd_swig.i
index 513c1da7e..99258c0f5 100644
--- a/gr-uhd/swig/uhd_swig.i
+++ b/gr-uhd/swig/uhd_swig.i
@@ -76,6 +76,8 @@
%include <uhd/types/time_spec.hpp>
+%include <uhd/types/stream_cmd.hpp>
+
%include <uhd/types/clock_config.hpp>
%include <uhd/types/metadata.hpp>