aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-12-14 16:20:58 -0800
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:06:11 -0800
commit9e5fb0c49f7911e0e9f6e9390e81d9465304cfeb (patch)
treec54c9292f3d0b008b4e7c36ee1faa1f5f8833e68 /host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp
parent3ee587672022ed9b7093b22d25bc8e2a4432f618 (diff)
downloaduhd-9e5fb0c49f7911e0e9f6e9390e81d9465304cfeb.tar.gz
uhd-9e5fb0c49f7911e0e9f6e9390e81d9465304cfeb.tar.bz2
uhd-9e5fb0c49f7911e0e9f6e9390e81d9465304cfeb.zip
mg: Add 'identify' block arg, will toggle LEDs for identification
Diffstat (limited to 'host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp')
-rw-r--r--host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp
index 7796b8b47..f54112ac8 100644
--- a/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp
+++ b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_impl.cpp
@@ -19,6 +19,7 @@
#include <boost/format.hpp>
#include <sstream>
#include <cmath>
+#include <cstdlib>
using namespace uhd;
using namespace uhd::usrp;
@@ -755,6 +756,18 @@ void magnesium_radio_ctrl_impl::set_rpc_client(
)
);
+ if (_master and block_args.has_key("identify")) {
+ const std::string identify_val = block_args.get("identify");
+ int identify_duration = std::atoi(identify_val.c_str());
+ if (identify_duration == 0) {
+ identify_duration = 5;
+ }
+ UHD_LOG_INFO(unique_id(),
+ "Running LED identification process for " << identify_duration
+ << " seconds.");
+ _identify_with_leds(identify_duration);
+ }
+
// Note: MCR gets set during the init() call (prior to this), which takes
// in arguments from the device args. So if block_args contains a
// master_clock_rate key, then it should better be whatever the device is