diff options
author | Martin Braun <martin.braun@ettus.com> | 2019-06-07 10:01:21 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-11-26 11:49:23 -0800 |
commit | 802afa6eecee368ec8e28044ce22fd39c0f93ae8 (patch) | |
tree | 1104d60784f0221a1dfa954b3bc1ebbe0562acba /host/lib/rfnoc/rfnoc_graph.cpp | |
parent | 03023905360dd2c9c17ba70ff1543b0c70f98ad4 (diff) | |
download | uhd-802afa6eecee368ec8e28044ce22fd39c0f93ae8.tar.gz uhd-802afa6eecee368ec8e28044ce22fd39c0f93ae8.tar.bz2 uhd-802afa6eecee368ec8e28044ce22fd39c0f93ae8.zip |
rfnoc: rfnoc_graph: Add API to query the number of motherboards
Diffstat (limited to 'host/lib/rfnoc/rfnoc_graph.cpp')
-rw-r--r-- | host/lib/rfnoc/rfnoc_graph.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
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; |