From 23729861a2020359b9c920347bd2d7c43d96ebf8 Mon Sep 17 00:00:00 2001 From: Julian Arnold Date: Tue, 16 Dec 2014 12:08:56 -0800 Subject: e300: rssi sensor network support --- host/lib/usrp/e300/e300_remote_codec_ctrl.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'host/lib/usrp/e300/e300_remote_codec_ctrl.cpp') diff --git a/host/lib/usrp/e300/e300_remote_codec_ctrl.cpp b/host/lib/usrp/e300/e300_remote_codec_ctrl.cpp index bcc8ee4cf..ed8131e2f 100644 --- a/host/lib/usrp/e300/e300_remote_codec_ctrl.cpp +++ b/host/lib/usrp/e300/e300_remote_codec_ctrl.cpp @@ -106,6 +106,20 @@ public: _transact(); } + sensor_value_t get_rssi(const std::string &which) + { + _clear(); + _args.action = uhd::htonx(transaction_t::ACTION_GET_RSSI); + if (which == "RX1") _args.which = uhd::htonx(transaction_t::CHAIN_RX1); + else if (which == "RX2") _args.which = uhd::htonx(transaction_t::CHAIN_RX2); + else throw std::runtime_error("e300_remote_codec_ctrl_impl incorrect chain string."); + _args.bits = uhd::htonx(0); + + _transact(); + + return sensor_value_t("RSSI", _retval.rssi, "dB"); + } + private: void _transact() { { -- cgit v1.2.3