From 802afa6eecee368ec8e28044ce22fd39c0f93ae8 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Fri, 7 Jun 2019 10:01:21 -0700 Subject: rfnoc: rfnoc_graph: Add API to query the number of motherboards --- host/lib/rfnoc/rfnoc_graph.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'host/lib') diff --git a/host/lib/rfnoc/rfnoc_graph.cpp b/host/lib/rfnoc/rfnoc_graph.cpp index 09e159282..01f669c62 100644 --- a/host/lib/rfnoc/rfnoc_graph.cpp +++ b/host/lib/rfnoc/rfnoc_graph.cpp @@ -111,6 +111,12 @@ public: return _mb_controllers.at(mb_index); } + + size_t get_num_mboards() const + { + return _num_mboards; + } + void commit() { _graph->commit(); @@ -156,7 +162,7 @@ private: // Enumerate blocks, load them into the block registry // Iterate through the mboards - for (size_t mb_idx = 0; mb_idx < _device->get_num_mbs(); ++mb_idx) { + for (size_t mb_idx = 0; mb_idx < get_num_mboards(); ++mb_idx) { // Setup the interfaces for this mboard and get some configuration info mb_iface& mb = _device->get_mb_iface(mb_idx); // Ask GSM to allow us to talk to our remote mb @@ -343,6 +349,10 @@ private: //! Reference to the underlying device implementation detail::rfnoc_device::sptr _device; + //! Number of motherboards, this is technically redundant but useful for + // easy lookups. + size_t _num_mboards; + //! Reference to the property tree uhd::property_tree::sptr _tree; -- cgit v1.2.3