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

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Mon Aug 26 15:11:26 UTC 2019


pespin has uploaded this change for review. ( 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

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



  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/92/15292/1

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: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190826/8f76c726/attachment.htm>


More information about the gerrit-log mailing list