From b81a48205a2ab29c699134b81899c221807b4860 Mon Sep 17 00:00:00 2001 From: Tom Rondeau <trondeau@vt.edu> Date: Fri, 8 Mar 2013 14:23:04 -0500 Subject: ctrlport: adding ability to set/get sample rate of USRP source/sink over controlport. --- gr-uhd/lib/usrp_source_impl.cc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'gr-uhd/lib/usrp_source_impl.cc') diff --git a/gr-uhd/lib/usrp_source_impl.cc b/gr-uhd/lib/usrp_source_impl.cc index 9d6a55ae5a..ad3ffef2ad 100644 --- a/gr-uhd/lib/usrp_source_impl.cc +++ b/gr-uhd/lib/usrp_source_impl.cc @@ -624,5 +624,27 @@ namespace gr { return num_samps; } + void + usrp_source_impl::setup_rpc() + { +#ifdef GR_CTRLPORT + add_rpc_variable( + rpcbasic_sptr(new rpcbasic_register_get<usrp_source, double>( + alias(), "samp_rate", + &usrp_source::get_samp_rate, + pmt::mp(100000.0f), pmt::mp(25000000.0f), pmt::mp(1000000.0f), + "sps", "RX Sample Rate", RPC_PRIVLVL_MIN, + DISPTIME | DISPOPTSTRIP))); + + add_rpc_variable( + rpcbasic_sptr(new rpcbasic_register_set<usrp_source, double>( + alias(), "samp_rate", + &usrp_source::set_samp_rate, + pmt::mp(100000.0f), pmt::mp(25000000.0f), pmt::mp(1000000.0f), + "sps", "RX Sample Rate", + RPC_PRIVLVL_MIN, DISPNULL))); +#endif /* GR_CTRLPORT */ + } + } /* namespace uhd */ } /* namespace gr */ -- cgit v1.2.3