aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/include/uhdlib
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2019-07-31 14:34:36 -0700
committerMartin Braun <martin.braun@ettus.com>2019-11-26 11:49:34 -0800
commitd717feaf3d6ce6f8823a6437000e0394b5b68134 (patch)
tree210870b5f95c8c7994b78357f11e70302b1839ef /host/lib/include/uhdlib
parentbf986d32632199917dc811f00465ecf409c64a76 (diff)
downloaduhd-d717feaf3d6ce6f8823a6437000e0394b5b68134.tar.gz
uhd-d717feaf3d6ce6f8823a6437000e0394b5b68134.tar.bz2
uhd-d717feaf3d6ce6f8823a6437000e0394b5b68134.zip
rfnoc: radio: Introduce coerce_rate() method
This is a helper method for property resolution, where set_rate() is not appropriate.
Diffstat (limited to 'host/lib/include/uhdlib')
-rw-r--r--host/lib/include/uhdlib/rfnoc/radio_control_impl.hpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/host/lib/include/uhdlib/rfnoc/radio_control_impl.hpp b/host/lib/include/uhdlib/rfnoc/radio_control_impl.hpp
index 6b50cc31c..fc90035f7 100644
--- a/host/lib/include/uhdlib/rfnoc/radio_control_impl.hpp
+++ b/host/lib/include/uhdlib/rfnoc/radio_control_impl.hpp
@@ -256,6 +256,22 @@ public:
static const uhd::fs_path FE_PATH;
protected:
+ /*! Helper function for property propagation: Like set_rate(), but called
+ * during a different context.
+ *
+ * This function is called from the samp_rate property resolver. The
+ * difference to set_rate() is that the latter is a user API, and may
+ * trigger different kinds of warnings or errors.
+ * If the radio supports changing its sampling rate at runtime, it is OK to
+ * call set_rate() within this function.
+ *
+ * Default implementation is to simply return the current rate.
+ */
+ virtual double coerce_rate(const double /* rate */)
+ {
+ return _rate;
+ }
+
//! Properties for samp_rate (one per port)
std::vector<property_t<double>> _samp_rate_in;
//! Properties for samp_rate (one per port)