Change in osmo-trx[master]: move set_antennas() from UHD to generic radioDevice base class

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon Jun 18 09:40:46 UTC 2018


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/9618 )

Change subject: move set_antennas() from UHD to generic radioDevice base class
......................................................................

move set_antennas() from UHD to generic radioDevice base class

Change-Id: I806143e9db21f0be4dcc6a376b3a630be7aeb3ba
---
M Transceiver52M/device/lms/LMSDevice.h
M Transceiver52M/device/radioDevice.h
M Transceiver52M/device/uhd/UHDDevice.cpp
M Transceiver52M/device/usrp1/USRPDevice.h
4 files changed, 29 insertions(+), 33 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Pau Espin Pedrol: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved



diff --git a/Transceiver52M/device/lms/LMSDevice.h b/Transceiver52M/device/lms/LMSDevice.h
index 99eed43..7b3479f 100644
--- a/Transceiver52M/device/lms/LMSDevice.h
+++ b/Transceiver52M/device/lms/LMSDevice.h
@@ -196,8 +196,6 @@
 	inline double numberWritten() {
 		return samplesWritten;
 	}
-
-	std::vector < std::string > tx_paths, rx_paths;
 };
 
 #endif // _LMS_DEVICE_H_
diff --git a/Transceiver52M/device/radioDevice.h b/Transceiver52M/device/radioDevice.h
index c5cd461..469b574 100644
--- a/Transceiver52M/device/radioDevice.h
+++ b/Transceiver52M/device/radioDevice.h
@@ -19,6 +19,7 @@
 #include <vector>
 
 #include "GSMCommon.h"
+#include "Logger.h"
 
 extern "C" {
 #include "config_defs.h"
@@ -163,6 +164,34 @@
   virtual double numberRead()=0;
   virtual double numberWritten()=0;
 
+  std::vector<std::string> tx_paths, rx_paths;
+  bool set_antennas() {
+	unsigned int i;
+
+	for (i = 0; i < tx_paths.size(); i++) {
+		if (tx_paths[i] == "")
+			continue;
+		LOG(DEBUG) << "Configuring channel " << i << " with antenna " << tx_paths[i];
+		if (!setTxAntenna(tx_paths[i], i)) {
+			LOG(ALERT) << "Failed configuring channel " << i << " with antenna " << tx_paths[i];
+			return false;
+		}
+	}
+
+	for (i = 0; i < rx_paths.size(); i++) {
+		if (rx_paths[i] == "")
+			continue;
+		LOG(DEBUG) << "Configuring channel " << i << " with antenna " << rx_paths[i];
+		if (!setRxAntenna(rx_paths[i], i)) {
+			LOG(ALERT) << "Failed configuring channel " << i << " with antenna " << rx_paths[i];
+			return false;
+		}
+	}
+	LOG(INFO) << "Antennas configured successfully";
+	return true;
+  }
+
+
 };
 
 #endif
diff --git a/Transceiver52M/device/uhd/UHDDevice.cpp b/Transceiver52M/device/uhd/UHDDevice.cpp
index a0052c8..77a3446 100644
--- a/Transceiver52M/device/uhd/UHDDevice.cpp
+++ b/Transceiver52M/device/uhd/UHDDevice.cpp
@@ -291,7 +291,6 @@
 
 	std::vector<double> tx_gains, rx_gains;
 	std::vector<double> tx_freqs, rx_freqs;
-	std::vector<std::string> tx_paths, rx_paths;
 	size_t tx_spp, rx_spp;
 
 	bool started;
@@ -307,7 +306,6 @@
 	void init_gains();
 	void set_channels(bool swap);
 	void set_rates();
-	bool set_antennas();
 	bool parse_dev_type();
 	bool flush_recv(size_t num_pkts);
 	int check_rx_md_err(uhd::rx_metadata_t &md, ssize_t num_smpls);
@@ -458,33 +456,6 @@
 	LOG(INFO) << "Rates configured for " << desc.str;
 }
 
-bool uhd_device::set_antennas()
-{
-	unsigned int i;
-
-	for (i = 0; i < tx_paths.size(); i++) {
-		if (tx_paths[i] == "")
-			continue;
-		LOG(DEBUG) << "Configuring channel " << i << " with antenna " << tx_paths[i];
-		if (!setTxAntenna(tx_paths[i], i)) {
-			LOG(ALERT) << "Failed configuring channel " << i << " with antenna " << tx_paths[i];
-			return false;
-		}
-	}
-
-	for (i = 0; i < rx_paths.size(); i++) {
-		if (rx_paths[i] == "")
-			continue;
-		LOG(DEBUG) << "Configuring channel " << i << " with antenna " << rx_paths[i];
-		if (!setRxAntenna(rx_paths[i], i)) {
-			LOG(ALERT) << "Failed configuring channel " << i << " with antenna " << rx_paths[i];
-			return false;
-		}
-	}
-	LOG(INFO) << "Antennas configured successfully";
-	return true;
-}
-
 double uhd_device::setTxGain(double db, size_t chan)
 {
 	if (iface == MULTI_ARFCN)
diff --git a/Transceiver52M/device/usrp1/USRPDevice.h b/Transceiver52M/device/usrp1/USRPDevice.h
index 6304ea1..efdedb3 100644
--- a/Transceiver52M/device/usrp1/USRPDevice.h
+++ b/Transceiver52M/device/usrp1/USRPDevice.h
@@ -203,8 +203,6 @@
   inline double getSampleRate() { return actualSampleRate; }
   inline double numberRead() { return samplesRead; }
   inline double numberWritten() { return samplesWritten; }
-
-  std::vector<std::string> tx_paths, rx_paths;
 };
 
 #endif // _USRP_DEVICE_H_

-- 
To view, visit https://gerrit.osmocom.org/9618
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I806143e9db21f0be4dcc6a376b3a630be7aeb3ba
Gerrit-Change-Number: 9618
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180618/1f1102de/attachment.htm>


More information about the gerrit-log mailing list