diff options
author | Martin Braun <martin.braun@ettus.com> | 2017-12-21 17:30:31 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-12-22 15:06:11 -0800 |
commit | 3b32e3b0de79898db5f7db5f47eeaf06a65d4a19 (patch) | |
tree | 46ed2c2276b5174040145e64e7e5af327e7e2e94 /host | |
parent | 9e5fb0c49f7911e0e9f6e9390e81d9465304cfeb (diff) | |
download | uhd-3b32e3b0de79898db5f7db5f47eeaf06a65d4a19.tar.gz uhd-3b32e3b0de79898db5f7db5f47eeaf06a65d4a19.tar.bz2 uhd-3b32e3b0de79898db5f7db5f47eeaf06a65d4a19.zip |
mpmd: Temporarily disable setting of clock and time source
Currently, calling these APIs could potentially put the device into bad
state. This will disable the APIs from UHD side and replace them with a
warning if the user's setting did not take effect.
Diffstat (limited to 'host')
-rw-r--r-- | host/lib/usrp/mpmd/mpmd_impl.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/host/lib/usrp/mpmd/mpmd_impl.cpp b/host/lib/usrp/mpmd/mpmd_impl.cpp index 7b4ca5bc8..e8eb2ea6a 100644 --- a/host/lib/usrp/mpmd/mpmd_impl.cpp +++ b/host/lib/usrp/mpmd/mpmd_impl.cpp @@ -93,7 +93,18 @@ namespace { /*** Clocking *******************************************************/ tree->create<std::string>(mb_path / "clock_source/value") .add_coerced_subscriber([mb](const std::string &clock_source){ - mb->rpc->notify_with_token("set_clock_source", clock_source); + // FIXME: Undo these changes + //mb->rpc->notify_with_token("set_clock_source", clock_source); + auto current_src = mb->rpc->request_with_token<std::string>( + "get_clock_source" + ); + if (current_src != clock_source) { + UHD_LOG_WARNING("MPMD", + "Setting clock source at runtime is currently not " + "supported. Use clock_source=XXX as a device arg to " + "select a clock source. The current source is: " + << current_src); + } }) .set_publisher([mb](){ return mb->rpc->request_with_token<std::string>( @@ -111,7 +122,18 @@ namespace { ; tree->create<std::string>(mb_path / "time_source/value") .add_coerced_subscriber([mb](const std::string &time_source){ - mb->rpc->notify_with_token("set_time_source", time_source); + //mb->rpc->notify_with_token("set_time_source", time_source); + // FIXME: Undo these changes + auto current_src = mb->rpc->request_with_token<std::string>( + "get_time_source" + ); + if (current_src != time_source) { + UHD_LOG_WARNING("MPMD", + "Setting time source at runtime is currently not " + "supported. Use time_source=XXX as a device arg to " + "select a time source. The current source is: " + << current_src); + } }) .set_publisher([mb](){ return mb->rpc->request_with_token<std::string>( |