From 1d0c25ef7d9fc9f0a2e1d171ade1adf56abaf03c Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 28 Mar 2018 14:39:30 -0700 Subject: multi_usrp: Add API call to query the clock rate range --- host/lib/usrp/multi_usrp.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'host/lib') diff --git a/host/lib/usrp/multi_usrp.cpp b/host/lib/usrp/multi_usrp.cpp index 3af762c82..f9509b7f3 100644 --- a/host/lib/usrp/multi_usrp.cpp +++ b/host/lib/usrp/multi_usrp.cpp @@ -465,6 +465,23 @@ public: return _tree->access(mb_root(mboard) / "tick_rate").get(); } + meta_range_t get_master_clock_rate_range(const size_t mboard) + { + if (_tree->exists(mb_root(mboard) / "tick_rate/range")) { + return _tree->access( + mb_root(mboard) / "tick_rate/range" + ).get(); + } + // The USRP may not have a range defined, in which case we create a + // fake range with a single value: + const double tick_rate = get_master_clock_rate(mboard); + return meta_range_t( + tick_rate, + tick_rate, + 0 + ); + } + std::string get_pp_string(void){ std::string buff = str(boost::format( "%s USRP:\n" -- cgit v1.2.3