diff options
author | Martin Braun <martin.braun@ettus.com> | 2018-01-16 13:10:37 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-01-16 13:10:37 -0800 |
commit | 0da3eefcc332fffea0b229a9d2bceeb1643e8ec3 (patch) | |
tree | fa8bb0d78299df0a2579cdd400e9fe5541fa1bc5 /host/lib/usrp/mpmd | |
parent | 3d2a9ac551f8e596bcc9d429c12b0cf571c8a9e5 (diff) | |
download | uhd-0da3eefcc332fffea0b229a9d2bceeb1643e8ec3.tar.gz uhd-0da3eefcc332fffea0b229a9d2bceeb1643e8ec3.tar.bz2 uhd-0da3eefcc332fffea0b229a9d2bceeb1643e8ec3.zip |
mpm/mpmd: Report device state using get_init_status() and verify
When trying to run init(), mpmd will first query the initialization
status of the MPM device. If it is found to be in a bad state, it will
not go forward with initialization, but instead print the error message.
Diffstat (limited to 'host/lib/usrp/mpmd')
-rw-r--r-- | host/lib/usrp/mpmd/mpmd_mboard_impl.cpp | 9 |
1 files changed, 9 insertions, 0 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" |