diff options
-rw-r--r-- | host/lib/usrp/mpmd/mpmd_mboard_impl.cpp | 9 | ||||
-rw-r--r-- | mpm/python/usrp_mpm/periph_manager/base.py | 8 |
2 files changed, 16 insertions, 1 deletions
diff --git a/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp b/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp index bd792ce59..274e2d370 100644 --- a/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp +++ b/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp @@ -37,6 +37,15 @@ namespace { uhd::rpc_client::sptr rpc, const uhd::device_addr_t mb_args ) { + auto init_status = + rpc->request_with_token<std::vector<std::string>>( + "get_init_status"); + if (init_status[0] != "true") { + throw uhd::runtime_error( + std::string("Device is in bad state: ") + init_status[1] + ); + } + // TODO maybe put this somewhere else? const std::set<std::string> key_blacklist{ "serial", "claimed", "type", "rev", "addr" diff --git a/mpm/python/usrp_mpm/periph_manager/base.py b/mpm/python/usrp_mpm/periph_manager/base.py index 5b30bf1ec..93edb36ce 100644 --- a/mpm/python/usrp_mpm/periph_manager/base.py +++ b/mpm/python/usrp_mpm/periph_manager/base.py @@ -377,11 +377,17 @@ class PeriphManagerBase(object): """ Returns the status of the device after its initialization (that happens at startup, not that happens when init() is called). + The status is a tuple of 2 strings, the first is either "true" or + "false", depending on whether or not the device initialization was + successful, and the second is an arbitrary error string. Use this function to figure out if something went wrong at bootup, and what. """ - return self._initialization_status + return [ + "true" if self._device_initialized else "false", + self._initialization_status + ] @no_claim def list_available_overlays(self): |