summaryrefslogtreecommitdiff
path: root/gr-uhd/lib
diff options
context:
space:
mode:
authorTom Rondeau <tom@trondeau.com>2015-12-06 18:23:19 -0500
committerTom Rondeau <tom@trondeau.com>2015-12-06 18:23:19 -0500
commitbd339909e6a89fc2e9db582ba01960a0283b4506 (patch)
treea3643a4e7dbc446dabd0e93c322518e274581f38 /gr-uhd/lib
parentd55fde354f257a1dd615a66c4ca98e3b6c6a5854 (diff)
uhd: Added controlport interface for UHD sink's "command" message handler.
Also added an example, usrp_sink_controller.py, to excercise this feature. Fixed up the source example, too, to better manage parsing options and setting the UHD source block alias (defaults to 'gr uhd usrp source0', which is the default for any flowgraph with a single UHD source block).
Diffstat (limited to 'gr-uhd/lib')
-rw-r--r--gr-uhd/lib/usrp_sink_impl.cc13
-rw-r--r--gr-uhd/lib/usrp_sink_impl.h2
2 files changed, 15 insertions, 0 deletions
diff --git a/gr-uhd/lib/usrp_sink_impl.cc b/gr-uhd/lib/usrp_sink_impl.cc
index 8f2d2ad4a3..64d25bde30 100644
--- a/gr-uhd/lib/usrp_sink_impl.cc
+++ b/gr-uhd/lib/usrp_sink_impl.cc
@@ -618,5 +618,18 @@ namespace gr {
return true;
}
+
+ void
+ usrp_sink_impl::setup_rpc()
+ {
+#ifdef GR_CTRLPORT
+ add_rpc_variable(
+ rpcbasic_sptr(new rpcbasic_register_handler<usrp_block>(
+ alias(), "command",
+ "", "UHD Commands",
+ RPC_PRIVLVL_MIN, DISPNULL)));
+#endif /* GR_CTRLPORT */
+ }
+
} /* namespace uhd */
} /* namespace gr */
diff --git a/gr-uhd/lib/usrp_sink_impl.h b/gr-uhd/lib/usrp_sink_impl.h
index 1575378d21..d509baef90 100644
--- a/gr-uhd/lib/usrp_sink_impl.h
+++ b/gr-uhd/lib/usrp_sink_impl.h
@@ -103,6 +103,8 @@ namespace gr {
inline void tag_work(int &ninput_items);
+ void setup_rpc();
+
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);