Change in ...osmo-trx[master]: radioInterface: Rename mRadio to mDevice

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 11:21:04 UTC 2019


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

Change subject: radioInterface: Rename mRadio to mDevice
......................................................................

radioInterface: Rename mRadio to mDevice

Previous naming is ready confusing, because "Radio" is actually the
common term between radioInterface and radioDevice, and it looks like
it's referring to radioInterface rather than radioDevice. On the other
hand, mDevice cleary states it refers to the radioDevice item.

Change-Id: I708bb1992a156fb63334f5590f2c6648ca27495e
---
M Transceiver52M/radioInterface.cpp
M Transceiver52M/radioInterface.h
M Transceiver52M/radioInterfaceMulti.cpp
M Transceiver52M/radioInterfaceResamp.cpp
4 files changed, 37 insertions(+), 37 deletions(-)

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



diff --git a/Transceiver52M/radioInterface.cpp b/Transceiver52M/radioInterface.cpp
index 0d33f22..bd19b24 100644
--- a/Transceiver52M/radioInterface.cpp
+++ b/Transceiver52M/radioInterface.cpp
@@ -32,10 +32,10 @@
 #define CHUNK		625
 #define NUMCHUNKS	4
 
-RadioInterface::RadioInterface(RadioDevice *wRadio, size_t tx_sps,
+RadioInterface::RadioInterface(RadioDevice *wDevice, size_t tx_sps,
                                size_t rx_sps, size_t chans,
                                int wReceiveOffset, GSM::Time wStartTime)
-  : mRadio(wRadio), mSPSTx(tx_sps), mSPSRx(rx_sps), mChans(chans),
+  : mDevice(wDevice), mSPSTx(tx_sps), mSPSRx(rx_sps), mChans(chans),
     underrun(false), overrun(false), writeTimestamp(0), readTimestamp(0),
     receiveOffset(wReceiveOffset), mOn(false)
 {
@@ -93,11 +93,11 @@
 }
 
 double RadioInterface::fullScaleInputValue(void) {
-  return mRadio->fullScaleInputValue();
+  return mDevice->fullScaleInputValue();
 }
 
 double RadioInterface::fullScaleOutputValue(void) {
-  return mRadio->fullScaleOutputValue();
+  return mDevice->fullScaleOutputValue();
 }
 
 int RadioInterface::setPowerAttenuation(int atten, size_t chan)
@@ -112,8 +112,8 @@
   if (atten < 0.0)
     atten = 0.0;
 
-  rfGain = mRadio->setTxGain(mRadio->maxTxGain() - (double) atten, chan);
-  digAtten = (double) atten - mRadio->maxTxGain() + rfGain;
+  rfGain = mDevice->setTxGain(mDevice->maxTxGain() - (double) atten, chan);
+  digAtten = (double) atten - mDevice->maxTxGain() + rfGain;
 
   if (digAtten < 1.0)
     powerScaling[chan] = 1.0;
@@ -148,12 +148,12 @@
 
 bool RadioInterface::tuneTx(double freq, size_t chan)
 {
-  return mRadio->setTxFreq(freq, chan);
+  return mDevice->setTxFreq(freq, chan);
 }
 
 bool RadioInterface::tuneRx(double freq, size_t chan)
 {
-  return mRadio->setRxFreq(freq, chan);
+  return mDevice->setRxFreq(freq, chan);
 }
 
 /** synchronization thread loop */
@@ -169,7 +169,7 @@
 }
 
 void RadioInterface::alignRadio() {
-  mRadio->updateAlignment(writeTimestamp+ (TIMESTAMP) 10000);
+  mDevice->updateAlignment(writeTimestamp+ (TIMESTAMP) 10000);
 }
 
 bool RadioInterface::start()
@@ -178,12 +178,12 @@
     return true;
 
   LOG(INFO) << "Starting radio device";
-  if (mRadio->requiresRadioAlign())
+  if (mDevice->requiresRadioAlign())
         mAlignRadioServiceLoopThread.start(
                                 (void * (*)(void*))AlignRadioServiceLoopAdapter,
                                 (void*)this);
 
-  if (!mRadio->start())
+  if (!mDevice->start())
     return false;
 
   for (size_t i = 0; i < mChans; i++) {
@@ -191,11 +191,11 @@
     recvBuffer[i]->reset();
   }
 
-  writeTimestamp = mRadio->initialWriteTimestamp();
-  readTimestamp = mRadio->initialReadTimestamp();
+  writeTimestamp = mDevice->initialWriteTimestamp();
+  readTimestamp = mDevice->initialReadTimestamp();
 
-  mRadio->updateAlignment(writeTimestamp-10000);
-  mRadio->updateAlignment(writeTimestamp-10000);
+  mDevice->updateAlignment(writeTimestamp-10000);
+  mDevice->updateAlignment(writeTimestamp-10000);
 
   mOn = true;
   LOG(INFO) << "Radio started";
@@ -211,7 +211,7 @@
  */
 bool RadioInterface::stop()
 {
-  if (!mOn || !mRadio->stop())
+  if (!mOn || !mDevice->stop())
     return false;
 
   mOn = false;
@@ -304,12 +304,12 @@
 
 double RadioInterface::setRxGain(double dB, size_t chan)
 {
-  return mRadio->setRxGain(dB, chan);
+  return mDevice->setRxGain(dB, chan);
 }
 
 double RadioInterface::getRxGain(size_t chan)
 {
-  return mRadio->getRxGain(chan);
+  return mDevice->getRxGain(chan);
 }
 
 /* Receive a timestamped chunk from the device */
@@ -323,7 +323,7 @@
     return -1;
 
   /* Outer buffer access size is fixed */
-  numRecv = mRadio->readSamples(convertRecvBuffer,
+  numRecv = mDevice->readSamples(convertRecvBuffer,
                                 segmentLen,
                                 &overrun,
                                 readTimestamp,
@@ -362,7 +362,7 @@
   }
 
   /* Send the all samples in the send buffer */
-  numSent = mRadio->writeSamples(convertSendBuffer,
+  numSent = mDevice->writeSamples(convertSendBuffer,
                                  segmentLen,
                                  &local_underrun,
                                  writeTimestamp);
diff --git a/Transceiver52M/radioInterface.h b/Transceiver52M/radioInterface.h
index dcfb67f..235d888 100644
--- a/Transceiver52M/radioInterface.h
+++ b/Transceiver52M/radioInterface.h
@@ -36,7 +36,7 @@
 
   std::vector<VectorFIFO>  mReceiveFIFO;      ///< FIFO that holds receive  bursts
 
-  RadioDevice *mRadio;			      ///< the USRP object
+  RadioDevice *mDevice;			      ///< the USRP object
 
   size_t mSPSTx;
   size_t mSPSRx;
@@ -84,7 +84,7 @@
   virtual void close();
 
   /** constructor */
-  RadioInterface(RadioDevice* wRadio, size_t tx_sps, size_t rx_sps,
+  RadioInterface(RadioDevice* wDevice, size_t tx_sps, size_t rx_sps,
                  size_t chans = 1, int receiveOffset = 3,
                  GSM::Time wStartTime = GSM::Time(0));
 
@@ -128,10 +128,10 @@
   double fullScaleOutputValue();
 
   /** get transport window type of attached device */
-  enum RadioDevice::TxWindowType getWindowType() { return mRadio->getWindowType(); }
+  enum RadioDevice::TxWindowType getWindowType() { return mDevice->getWindowType(); }
 
   /** Minimum latency that the device can achieve */
-  GSM::Time minLatency()  { return mRadio->minLatency(); }
+  GSM::Time minLatency()  { return mDevice->minLatency(); }
 
 protected:
   /** drive synchronization of Tx/Rx of USRP */
@@ -149,7 +149,7 @@
   int pullBuffer();
 
 public:
-  RadioInterfaceResamp(RadioDevice* wRadio, size_t tx_sps, size_t rx_sps);
+  RadioInterfaceResamp(RadioDevice* wDevice, size_t tx_sps, size_t rx_sps);
   ~RadioInterfaceResamp();
 
   bool init(int type);
diff --git a/Transceiver52M/radioInterfaceMulti.cpp b/Transceiver52M/radioInterfaceMulti.cpp
index 0208e82..7c1ee74 100644
--- a/Transceiver52M/radioInterfaceMulti.cpp
+++ b/Transceiver52M/radioInterfaceMulti.cpp
@@ -238,7 +238,7 @@
 		return -1;
 
 	/* Outer buffer access size is fixed */
-	num = mRadio->readSamples(convertRecvBuffer,
+	num = mDevice->readSamples(convertRecvBuffer,
 				  outerRecvBuffer->size(),
 				  &overrun,
 				  readTimestamp,
@@ -339,7 +339,7 @@
 			    (float *) outerSendBuffer->begin(),
 			    1.0 / (float) mChans, 2 * outerSendBuffer->size());
 
-	size_t num = mRadio->writeSamples(convertSendBuffer,
+	size_t num = mDevice->writeSamples(convertSendBuffer,
 					  outerSendBuffer->size(),
 					  &underrun,
 					  writeTimestamp);
@@ -368,9 +368,9 @@
   double shift = (double) getFreqShift(mChans);
 
   if (!chan)
-    return mRadio->setTxFreq(freq + shift * MCBTS_SPACING);
+    return mDevice->setTxFreq(freq + shift * MCBTS_SPACING);
 
-  double center = mRadio->getTxFreq();
+  double center = mDevice->getTxFreq();
   if (!fltcmp(freq, center + (double) (chan - shift) * MCBTS_SPACING)) {
     LOG(NOTICE) << "Channel " << chan << " RF frequency offset is "
                 << freq / 1e6 << " MHz";
@@ -387,9 +387,9 @@
   double shift = (double) getFreqShift(mChans);
 
   if (!chan)
-    return mRadio->setRxFreq(freq + shift * MCBTS_SPACING);
+    return mDevice->setRxFreq(freq + shift * MCBTS_SPACING);
 
-  double center = mRadio->getRxFreq();
+  double center = mDevice->getRxFreq();
   if (!fltcmp(freq, center + (double) (chan - shift) * MCBTS_SPACING)) {
     LOG(NOTICE) << "Channel " << chan << " RF frequency offset is "
                 << freq / 1e6 << " MHz";
@@ -401,7 +401,7 @@
 double RadioInterfaceMulti::setRxGain(double db, size_t chan)
 {
   if (!chan)
-    return mRadio->setRxGain(db);
+    return mDevice->setRxGain(db);
   else
-    return mRadio->getRxGain();
+    return mDevice->getRxGain();
 }
diff --git a/Transceiver52M/radioInterfaceResamp.cpp b/Transceiver52M/radioInterfaceResamp.cpp
index e2f69f2..d6dc52c 100644
--- a/Transceiver52M/radioInterfaceResamp.cpp
+++ b/Transceiver52M/radioInterfaceResamp.cpp
@@ -59,9 +59,9 @@
 static size_t resamp_outrate = 0;
 static size_t resamp_outchunk = 0;
 
-RadioInterfaceResamp::RadioInterfaceResamp(RadioDevice *wRadio,
+RadioInterfaceResamp::RadioInterfaceResamp(RadioDevice *wDevice,
 					   size_t tx_sps, size_t rx_sps)
-	: RadioInterface(wRadio, tx_sps, rx_sps, 1),
+	: RadioInterface(wDevice, tx_sps, rx_sps, 1),
 	  outerSendBuffer(NULL), outerRecvBuffer(NULL)
 {
 }
@@ -171,7 +171,7 @@
 		return -1;
 
 	/* Outer buffer access size is fixed */
-	num_recv = mRadio->readSamples(convertRecvBuffer,
+	num_recv = mDevice->readSamples(convertRecvBuffer,
 				       resamp_outchunk,
 				       &overrun,
 				       readTimestamp,
@@ -223,7 +223,7 @@
 			    (float *) outerSendBuffer->begin(),
 			    powerScaling[0], 2 * resamp_outchunk);
 
-	numSent = mRadio->writeSamples(convertSendBuffer,
+	numSent = mDevice->writeSamples(convertSendBuffer,
 				       resamp_outchunk,
 				       &underrun,
 				       writeTimestamp);

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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I708bb1992a156fb63334f5590f2c6648ca27495e
Gerrit-Change-Number: 15514
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: lynxis lazus <lynxis at fe80.eu>
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/09208036/attachment.htm>


More information about the gerrit-log mailing list