octoclock: Fix uhd_usrp_probe error

Running the uhd_usrp_probe utility was resulting in an error due to type
mismatch between the utility and the data type in the property tree.
The data type has been made consistent for all utilities and underlying
implementation code as a mboard_eeprom_t.

This reverts "octoclock: Fix type of eeprom object in property_tree".

Signed-off-by: michael-west <michael.west@ettus.com>
This commit is contained in:
michael-west 2023-03-31 12:06:30 -07:00 committed by Aki Tomita
parent e2576cfed4
commit 8e54b58d89
2 changed files with 13 additions and 10 deletions

View file

@ -264,10 +264,13 @@ octoclock_impl::octoclock_impl(const device_addr_t& _device_addr)
// Set up EEPROM
////////////////////////////////////////////////////////////////////
_oc_dict[oc].eeprom = octoclock_eeprom_t(_oc_dict[oc].ctrl_xport, _proto_ver);
_tree->create<octoclock_eeprom_t>(oc_path / "eeprom")
_tree->create<uhd::usrp::mboard_eeprom_t>(oc_path / "eeprom")
.set(_oc_dict[oc].eeprom)
.add_coerced_subscriber(
std::bind(&octoclock_impl::_set_eeprom, this, oc, std::placeholders::_1));
std::bind(&octoclock_impl::_set_eeprom, this, oc, std::placeholders::_1))
.set_publisher([this, oc]() {
return static_cast<uhd::usrp::mboard_eeprom_t>(this->_oc_dict[oc].eeprom);
});
////////////////////////////////////////////////////////////////////
// Initialize non-GPSDO sensors

View file

@ -8,7 +8,7 @@
#include <uhd/device.hpp>
#include <uhd/property_tree.hpp>
#include <uhd/types/device_addr.hpp>
#include <uhd/usrp_clock/octoclock_eeprom.hpp>
#include <uhd/usrp/mboard_eeprom.hpp>
#include <uhd/utils/safe_main.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/format.hpp>
@ -19,7 +19,7 @@
namespace po = boost::program_options;
using namespace uhd;
using namespace uhd::usrp_clock;
using namespace uhd::usrp;
int UHD_SAFE_MAIN(int argc, char* argv[])
{
@ -51,8 +51,8 @@ int UHD_SAFE_MAIN(int argc, char* argv[])
std::cout << "Creating OctoClock device from args: " + args << std::endl;
device::sptr oc = device::make(args, device::CLOCK);
property_tree::sptr tree = oc->get_tree();
octoclock_eeprom_t oc_eeprom =
tree->access<octoclock_eeprom_t>("/mboards/0/eeprom").get();
mboard_eeprom_t oc_eeprom =
tree->access<mboard_eeprom_t>("/mboards/0/eeprom").get();
std::cout << std::endl;
std::vector<std::string> keys_vec, vals_vec;
@ -89,10 +89,10 @@ int UHD_SAFE_MAIN(int argc, char* argv[])
<< std::endl;
}
}
tree->access<octoclock_eeprom_t>("/mboards/0/eeprom").set(oc_eeprom);
tree->access<mboard_eeprom_t>("/mboards/0/eeprom").set(oc_eeprom);
std::cout << std::endl
<< "Power-cycle your device to allow any changes to take effect."
<< std::endl;
}
std::cout << std::endl
<< "Power-cycle your device to allow any changes to take effect."
<< std::endl;
return EXIT_SUCCESS;
}