Change in ...osmo-trx[master]: radioInterfaceMulti: Override setTxGain() to avoid chan!=0 calls

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
Wed Sep 18 19:16:49 UTC 2019


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

Change subject: radioInterfaceMulti: Override setTxGain() to avoid chan!=0 calls
......................................................................

radioInterfaceMulti: Override setTxGain() to avoid chan!=0 calls

Change-Id: I7e67f660c3b0b009db59b405de603f6058021802
---
M Transceiver52M/radioInterface.cpp
M Transceiver52M/radioInterface.h
M Transceiver52M/radioInterfaceMulti.cpp
3 files changed, 19 insertions(+), 1 deletion(-)

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



diff --git a/Transceiver52M/radioInterface.cpp b/Transceiver52M/radioInterface.cpp
index 9c7c044..6e49a75 100644
--- a/Transceiver52M/radioInterface.cpp
+++ b/Transceiver52M/radioInterface.cpp
@@ -112,7 +112,7 @@
   if (atten < 0.0)
     atten = 0.0;
 
-  rfGain = mDevice->setTxGain(mDevice->maxTxGain() - (double) atten, chan);
+  rfGain = setTxGain(mDevice->maxTxGain() - (double) atten, chan);
   digAtten = (double) atten - mDevice->maxTxGain() + rfGain;
 
   if (digAtten < 1.0)
@@ -307,6 +307,11 @@
   return mDevice->setRxGain(dB, chan);
 }
 
+double RadioInterface::setTxGain(double dB, size_t chan)
+{
+  return mDevice->setTxGain(dB, chan);
+}
+
 /* Receive a timestamped chunk from the device */
 int RadioInterface::pullBuffer()
 {
diff --git a/Transceiver52M/radioInterface.h b/Transceiver52M/radioInterface.h
index 945624a..83e00b9 100644
--- a/Transceiver52M/radioInterface.h
+++ b/Transceiver52M/radioInterface.h
@@ -134,6 +134,9 @@
   /** drive synchronization of Tx/Rx of USRP */
   void alignRadio();
 
+  /** set transmit gain */
+  virtual double setTxGain(double dB, size_t chan = 0);
+
   friend void *AlignRadioServiceLoopAdapter(RadioInterface*);
 };
 
@@ -157,6 +160,7 @@
 private:
   bool pushBuffer();
   int pullBuffer();
+  virtual double setTxGain(double dB, size_t chan);
 
   signalVector *outerSendBuffer;
   signalVector *outerRecvBuffer;
diff --git a/Transceiver52M/radioInterfaceMulti.cpp b/Transceiver52M/radioInterfaceMulti.cpp
index c41ec22..4022d3a 100644
--- a/Transceiver52M/radioInterfaceMulti.cpp
+++ b/Transceiver52M/radioInterfaceMulti.cpp
@@ -405,3 +405,12 @@
   else
     return mDevice->getRxGain();
 }
+
+double RadioInterfaceMulti::setTxGain(double dB, size_t chan)
+{
+	if (chan == 0)
+		return mDevice->setTxGain(dB);
+	else
+		return mDevice->getTxGain();
+
+}

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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I7e67f660c3b0b009db59b405de603f6058021802
Gerrit-Change-Number: 15521
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: laforge <laforge at gnumonks.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190918/5ee3f484/attachment.htm>


More information about the gerrit-log mailing list