From 9d0750df6c90099eabd6d4108f51ebbee85ded21 Mon Sep 17 00:00:00 2001 From: Julian Arnold Date: Tue, 16 Dec 2014 13:32:40 -0800 Subject: ad9361: rssi readout --- host/lib/usrp/common/ad9361_ctrl.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'host/lib/usrp/common/ad9361_ctrl.cpp') diff --git a/host/lib/usrp/common/ad9361_ctrl.cpp b/host/lib/usrp/common/ad9361_ctrl.cpp index c84fcee39..f94536ed9 100644 --- a/host/lib/usrp/common/ad9361_ctrl.cpp +++ b/host/lib/usrp/common/ad9361_ctrl.cpp @@ -148,7 +148,7 @@ public: return _device.tune(direction, value); } - //! turn on/off Catalina's data port loopback + //! turn on/off data port loopback void data_port_loopback(const bool on) { boost::lock_guard lock(_mutex); @@ -156,6 +156,15 @@ public: _device.data_port_loopback(on); } + //! read internal RSSI sensor + sensor_value_t get_rssi(const std::string &which) + { + boost::lock_guard lock(_mutex); + + ad9361_device_t::chain_t chain =_get_chain_from_antenna(which); + return sensor_value_t("RSSI", _device.get_rssi(chain), "dB"); + } + private: static ad9361_device_t::direction_t _get_direction_from_antenna(const std::string& antenna) { -- cgit v1.2.3