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

2019-09-18 Thread pespin
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 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


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

2019-09-18 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-trx/+/15521 )

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


Patch Set 1: Code-Review+2

+1+1=+2


--
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 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 18 Sep 2019 19:16:06 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


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

2019-09-18 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-trx/+/15521 )

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


Patch Set 1: Code-Review+1

(1 comment)

https://gerrit.osmocom.org/#/c/15521/1/Transceiver52M/radioInterfaceMulti.cpp
File Transceiver52M/radioInterfaceMulti.cpp:

https://gerrit.osmocom.org/#/c/15521/1/Transceiver52M/radioInterfaceMulti.cpp@411
PS1, Line 411:
Cosmetic: other functions in this file are using two spaces as tab, so would be 
good to be consistent (neither I like tabs, but mixing is worse).



--
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 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 18 Sep 2019 17:43:14 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


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

2019-09-18 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-trx/+/15521 )

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


Patch Set 1:

> Patch Set 1:
>
> I don't know how the inheritance looks like, but aren't you actually adding 
> the setTxGain() method to both RadioInterface and *Multi?
>
> So you're overriding the RadioDevice setTxGain method in 
> RadioInterface(Multi)?

radioInterface class is the base and usual radio interface class (and it's not 
abstract, it's instantiable since it's the "simple usual" one). Then, there are 
2 child class extending and overriding some parts of the radioInterface base 
class:
-radioInterfaceResamp
-radioInterfaceMult

radioInterface{,Resamp,Mult} interact with its mDevice (radioDevice), which is 
an abstract class extended by LMSDevice, UHDDevice, USRPDevice.

In this commit I'm overriding radioInterface::setTxGain() in radioInterfaceMult 
to avoid calling radioDevice::setTxGain() on chans != 0 since it doesn't make 
sense to do so, because radioInterfaceMult is used when logical channels are 
multiplexed in one SDR physical channel, so in that scenario the radioDevice is 
going to be expecting to manage 1 physical channel.

This way we simplify the logic of each radioDevice implementation and keep it 
as much as possible inside radioInterfaceMult, responsible of muxing the 
multiple channels into one.


--
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 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 18 Sep 2019 13:59:37 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


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

2019-09-18 Thread daniel
daniel has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-trx/+/15521 )

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


Patch Set 1:

I don't know how the inheritance looks like, but aren't you actually adding the 
setTxGain() method to both RadioInterface and *Multi?

So you're overriding the RadioDevice setTxGain method in RadioInterface(Multi)?


--
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 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 18 Sep 2019 13:21:13 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


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

2019-09-14 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-trx/+/15521 )

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


Patch Set 1: Code-Review+1


--
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 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Sat, 14 Sep 2019 15:04:12 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


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

2019-09-13 Thread pespin
pespin has uploaded this change for review. ( 
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(-)



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

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 
Gerrit-MessageType: newchange