diff options
author | Tom Rondeau <trondeau@vt.edu> | 2013-03-01 11:44:42 -0500 |
---|---|---|
committer | Tom Rondeau <trondeau@vt.edu> | 2013-03-01 11:44:42 -0500 |
commit | ceb1c3496fd69cbff37a12e634c8baf7fc38f581 (patch) | |
tree | ad0460a13265918aaa2a7a28b3642999eebe86b1 | |
parent | 95f38c65bbdf1b1464999e7aa3275b3492dee3ac (diff) |
ctrlport: readding setup_rpc to throttle block that got lost in the transition.
-rw-r--r-- | gr-blocks/lib/throttle_impl.cc | 20 | ||||
-rw-r--r-- | gr-blocks/lib/throttle_impl.h | 2 |
2 files changed, 22 insertions, 0 deletions
diff --git a/gr-blocks/lib/throttle_impl.cc b/gr-blocks/lib/throttle_impl.cc index 49743e3f26..b1cfe4b3c8 100644 --- a/gr-blocks/lib/throttle_impl.cc +++ b/gr-blocks/lib/throttle_impl.cc @@ -93,5 +93,25 @@ namespace gr { return noutput_items; } + void + throttle_impl::setup_rpc() + { +#ifdef GR_CTRLPORT + d_rpc_vars.push_back( + rpcbasic_sptr(new rpcbasic_register_get<throttle, double>( + alias(), "sample_rate", &throttle::sample_rate, + pmt::mp(0.0), pmt::mp(100.0e6), pmt::mp(0.0), + "Hz", "Sample Rate", RPC_PRIVLVL_MIN, + DISPTIME | DISPOPTSTRIP))); + + d_rpc_vars.push_back( + rpcbasic_sptr(new rpcbasic_register_set<throttle, double>( + alias(), "sample_rate", &throttle::set_sample_rate, + pmt::mp(0.0), pmt::mp(100.0e6), pmt::mp(0.0), + "Hz", "Sample Rate", RPC_PRIVLVL_MIN, + DISPTIME | DISPOPTSTRIP))); +#endif /* GR_CTRLPORT */ + } + } /* namespace blocks */ } /* namespace gr */ diff --git a/gr-blocks/lib/throttle_impl.h b/gr-blocks/lib/throttle_impl.h index 86dbef2ac9..2f2cdf108b 100644 --- a/gr-blocks/lib/throttle_impl.h +++ b/gr-blocks/lib/throttle_impl.h @@ -40,6 +40,8 @@ namespace gr { throttle_impl(size_t itemsize, double samples_per_sec); ~throttle_impl(); + void setup_rpc(); + void set_sample_rate(double rate); double sample_rate() const; |