Change in ...osmo-trx[master]: lms: Log available antennas if requested antenna fails

laforge gerrit-no-reply at lists.osmocom.org
Tue Aug 27 12:10:59 UTC 2019


laforge has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmo-trx/+/15292 )

Change subject: lms: Log available antennas if requested antenna fails
......................................................................

lms: Log available antennas if requested antenna fails

Related: OS#3343
Change-Id: Icd328e85b0a75ef67f371a7ed72638053b1854f9
---
M Transceiver52M/device/lms/LMSDevice.cpp
M Transceiver52M/device/lms/LMSDevice.h
2 files changed, 23 insertions(+), 2 deletions(-)

Approvals:
  fixeria: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp
index f55b555..b7cb31d 100644
--- a/Transceiver52M/device/lms/LMSDevice.cpp
+++ b/Transceiver52M/device/lms/LMSDevice.cpp
@@ -431,6 +431,20 @@
 	return dB;
 }
 
+void LMSDevice::log_ant_list(bool dir_tx, size_t chan, std::ostringstream& os)
+{
+	lms_name_t name_list[MAX_ANTENNA_LIST_SIZE]; /* large enough list for antenna names. */
+	int num_names;
+	int i;
+
+	num_names = LMS_GetAntennaList(m_lms_dev, dir_tx, chan, name_list);
+	for (i = 0; i < num_names; i++) {
+		if (i)
+			os << ", ";
+		os << "'" << name_list[i] << "'";
+	}
+}
+
 int LMSDevice::get_ant_idx(const std::string & name, bool dir_tx, size_t chan)
 {
 	lms_name_t name_list[MAX_ANTENNA_LIST_SIZE]; /* large enough list for antenna names. */
@@ -484,7 +498,10 @@
 
 	idx = get_ant_idx(ant, LMS_CH_RX, chan);
 	if (idx < 0) {
-		LOGCHAN(chan, DDEV, ERROR) << "Invalid Rx Antenna";
+		std::ostringstream os;
+		LOGCHAN(chan, DDEV, ERROR) << "Invalid Rx Antenna: " << ant;
+		log_ant_list(LMS_CH_RX, chan, os);
+		LOGCHAN(chan, DDEV, NOTICE) << "Available Rx Antennas: " << os;
 		return false;
 	}
 
@@ -530,7 +547,10 @@
 
 	idx = get_ant_idx(ant, LMS_CH_TX, chan);
 	if (idx < 0) {
-		LOGCHAN(chan, DDEV, ERROR) << "Invalid Rx Antenna";
+		std::ostringstream os;
+		LOGCHAN(chan, DDEV, ERROR) << "Invalid Tx Antenna: " << ant;
+		log_ant_list(LMS_CH_TX, chan, os);
+		LOGCHAN(chan, DDEV, NOTICE) << "Available Tx Antennas: " << os;
 		return false;
 	}
 
diff --git a/Transceiver52M/device/lms/LMSDevice.h b/Transceiver52M/device/lms/LMSDevice.h
index 47bac94..ab45b08 100644
--- a/Transceiver52M/device/lms/LMSDevice.h
+++ b/Transceiver52M/device/lms/LMSDevice.h
@@ -63,6 +63,7 @@
 
 	bool do_calib(size_t chan);
 	bool do_filters(size_t chan);
+	void log_ant_list(bool dir_tx, size_t chan, std::ostringstream& os);
 	int get_ant_idx(const std::string & name, bool dir_tx, size_t chan);
 	bool flush_recv(size_t num_pkts);
 	void update_stream_stats_rx(size_t chan, bool *overrun);

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/15292
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: Icd328e85b0a75ef67f371a7ed72638053b1854f9
Gerrit-Change-Number: 15292
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: laforge <laforge at gnumonks.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190827/7139048f/attachment.html>


More information about the gerrit-log mailing list