diff options
author | Martin Braun <martin.braun@ettus.com> | 2017-06-06 11:28:20 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-12-22 15:03:59 -0800 |
commit | 59330ad80cfdd0694fd856c10ca84378dc54ff12 (patch) | |
tree | e67ecf705e7681eee202fc272947293fd603b36e /host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.cpp | |
parent | b14bc217e9598578bef89707ca4febc11e0f4290 (diff) | |
download | uhd-59330ad80cfdd0694fd856c10ca84378dc54ff12.tar.gz uhd-59330ad80cfdd0694fd856c10ca84378dc54ff12.tar.bz2 uhd-59330ad80cfdd0694fd856c10ca84378dc54ff12.zip |
eiscat: Make use of known number of dboards
Diffstat (limited to 'host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.cpp')
-rw-r--r-- | host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.cpp b/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.cpp index ea1e31102..35260150f 100644 --- a/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.cpp +++ b/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.cpp @@ -476,6 +476,20 @@ void eiscat_radio_ctrl_impl::set_rpc_client( ) { _rpcc = rpcc; _block_args = block_args; + auto dboard_info = + _rpcc->request<std::vector<std::map<std::string, std::string>>>( + "get_dboard_info" + ); + _num_dboards = dboard_info.size(); + UHD_LOG_DEBUG("EISCAT", "Using " << _num_dboards << " daughterboards."); + if (_num_dboards == 1) { + UHD_LOG_WARNING("EISCAT", + "Found 1 dboard, expected 2 for optimal operation." + ); + } else if (_num_dboards > 2) { + UHD_LOG_ERROR("EISCAT", "Detected too many dboards: " << _num_dboards); + throw uhd::runtime_error("Too many dboards detected."); + } UHD_LOG_INFO( "EISCAT", @@ -684,12 +698,18 @@ void eiscat_radio_ctrl_impl::enable_counter(bool enable) bool eiscat_radio_ctrl_impl::assert_adcs_deframers() { + if (_num_dboards == 1) { + return _rpcc->request_with_token<bool>("db_0_init_adcs_and_deframers"); + } return _rpcc->request_with_token<bool>("db_0_init_adcs_and_deframers") and _rpcc->request_with_token<bool>("db_1_init_adcs_and_deframers"); } bool eiscat_radio_ctrl_impl::assert_deframer_status() { + if (_num_dboards == 1) { + return _rpcc->request_with_token<bool>("db_0_check_deframer_status"); + } return _rpcc->request_with_token<bool>("db_0_check_deframer_status") and _rpcc->request_with_token<bool>("db_1_check_deframer_status"); } |