From 3b2f712ff9ceb6875f9e875d8e3424cd858d0a10 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Fri, 6 Mar 2020 14:28:37 -0800 Subject: utils/C API: Fix property tree access The introduction of multi_usrp_rfnoc caused multi_usrp::get_device()->get_tree() to segfault for gen3 devices. In defcb174, we introduced a fix for this (multi_usrp::get_tree()) but we didn't apply it to internal utilities. That means the uhd_cal_* utilties were broken, along with certain sections of the C API, and the latency test suite. This fixes the segfault issue. --- host/lib/usrp/usrp_c.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'host/lib') diff --git a/host/lib/usrp/usrp_c.cpp b/host/lib/usrp/usrp_c.cpp index e94b49fc8..bda9454b6 100644 --- a/host/lib/usrp/usrp_c.cpp +++ b/host/lib/usrp/usrp_c.cpp @@ -507,7 +507,7 @@ uhd_error uhd_usrp_get_mboard_eeprom( UHD_SAFE_C_SAVE_ERROR( h, uhd::fs_path eeprom_path = str(boost::format("/mboards/%d/eeprom") % mboard); - uhd::property_tree::sptr ptree = USRP(h)->get_device()->get_tree(); + uhd::property_tree::sptr ptree = USRP(h)->get_tree(); mb_eeprom->mboard_eeprom_cpp = ptree->access(eeprom_path).get();) } @@ -518,7 +518,7 @@ uhd_error uhd_usrp_set_mboard_eeprom( UHD_SAFE_C_SAVE_ERROR( h, uhd::fs_path eeprom_path = str(boost::format("/mboards/%d/eeprom") % mboard); - uhd::property_tree::sptr ptree = USRP(h)->get_device()->get_tree(); + uhd::property_tree::sptr ptree = USRP(h)->get_tree(); ptree->access(eeprom_path) .set(mb_eeprom->mboard_eeprom_cpp);) } @@ -534,7 +534,7 @@ uhd_error uhd_usrp_get_dboard_eeprom(uhd_usrp_handle h, uhd::fs_path eeprom_path = str(boost::format("/mboards/%d/dboards/%s/%s_eeprom") % mboard % slot % unit); - uhd::property_tree::sptr ptree = USRP(h)->get_device()->get_tree(); + uhd::property_tree::sptr ptree = USRP(h)->get_tree(); db_eeprom->dboard_eeprom_cpp = ptree->access(eeprom_path).get();) } @@ -550,7 +550,7 @@ uhd_error uhd_usrp_set_dboard_eeprom(uhd_usrp_handle h, uhd::fs_path eeprom_path = str(boost::format("/mboards/%d/dboards/%s/%s_eeprom") % mboard % slot % unit); - uhd::property_tree::sptr ptree = USRP(h)->get_device()->get_tree(); + uhd::property_tree::sptr ptree = USRP(h)->get_tree(); ptree->access(eeprom_path) .set(db_eeprom->dboard_eeprom_cpp);) } -- cgit v1.2.3