Change in osmo-trx[master]: radioDevice: Drop unused isControl param from WriteSamples API

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
Thu Mar 12 18:37:05 UTC 2020


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-trx/+/17476 )


Change subject: radioDevice: Drop unused isControl param from WriteSamples API
......................................................................

radioDevice: Drop unused isControl param from WriteSamples API

The out "isControl" parameter is only used by internal callers of
USRPDevice, and not used at all by any user of the generic API
(radioInterface*.cpp). Hence, we can get rid of it and keep it as a flag
for an internal API of USRPDevice.

Change-Id: I843384e24b76cdd28a95f9ee4e95e6157098e4a3
---
M Transceiver52M/device/common/radioDevice.h
M Transceiver52M/device/lms/LMSDevice.cpp
M Transceiver52M/device/lms/LMSDevice.h
M Transceiver52M/device/uhd/UHDDevice.cpp
M Transceiver52M/device/uhd/UHDDevice.h
M Transceiver52M/device/usrp1/USRPDevice.cpp
M Transceiver52M/device/usrp1/USRPDevice.h
7 files changed, 18 insertions(+), 26 deletions(-)



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

diff --git a/Transceiver52M/device/common/radioDevice.h b/Transceiver52M/device/common/radioDevice.h
index c504b3a..0dc38d5 100644
--- a/Transceiver52M/device/common/radioDevice.h
+++ b/Transceiver52M/device/common/radioDevice.h
@@ -87,11 +87,10 @@
         @param len number of samples to write.
         @param underrun Set if radio does not have data to transmit, e.g. data not being sent fast enough
         @param timestamp The timestamp of the first sample of the data buffer.
-        @param isControl Set if data is a control packet, e.g. a ping command
         @return The number of samples actually written
   */
   virtual int writeSamples(std::vector<short *> &bufs, int len, bool *underrun,
-                           TIMESTAMP timestamp, bool isControl = false) = 0;
+                           TIMESTAMP timestamp) = 0;
 
   /** Update the alignment between the read and write timestamps */
   virtual bool updateAlignment(TIMESTAMP timestamp)=0;
diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp
index 0cd8002..932817d 100644
--- a/Transceiver52M/device/lms/LMSDevice.cpp
+++ b/Transceiver52M/device/lms/LMSDevice.cpp
@@ -858,8 +858,7 @@
 }
 
 int LMSDevice::writeSamples(std::vector < short *>&bufs, int len,
-			    bool * underrun, unsigned long long timestamp,
-			    bool isControl)
+			    bool * underrun, unsigned long long timestamp)
 {
 	int rc = 0;
 	unsigned int i;
@@ -868,11 +867,6 @@
 	tx_metadata.waitForTimestamp = true;
 	tx_metadata.timestamp = timestamp - ts_offset;	/* Shift Tx time by offset */
 
-	if (isControl) {
-		LOGC(DDEV, ERROR) << "Control packets not supported";
-		return 0;
-	}
-
 	if (bufs.size() != chans) {
 		LOGC(DDEV, ERROR) << "Invalid channel combination " << bufs.size();
 		return -1;
diff --git a/Transceiver52M/device/lms/LMSDevice.h b/Transceiver52M/device/lms/LMSDevice.h
index c2fd2f6..5b6330a 100644
--- a/Transceiver52M/device/lms/LMSDevice.h
+++ b/Transceiver52M/device/lms/LMSDevice.h
@@ -117,12 +117,10 @@
 	@param len number of samples to write.
 	@param underrun Set if LMS does not have data to transmit, e.g. data not being sent fast enough
 	@param timestamp The timestamp of the first sample of the data buffer.
-	@param isControl Set if data is a control packet, e.g. a ping command
 	@return The number of samples actually written
 	*/
 	int writeSamples(std::vector < short *>&bufs, int len, bool * underrun,
-			 TIMESTAMP timestamp = 0xffffffff, bool isControl =
-			 false);
+			 TIMESTAMP timestamp = 0xffffffff);
 
 	/** Update the alignment between the read and write timestamps */
 	bool updateAlignment(TIMESTAMP timestamp);
diff --git a/Transceiver52M/device/uhd/UHDDevice.cpp b/Transceiver52M/device/uhd/UHDDevice.cpp
index ddb6631..ad56250 100644
--- a/Transceiver52M/device/uhd/UHDDevice.cpp
+++ b/Transceiver52M/device/uhd/UHDDevice.cpp
@@ -804,7 +804,7 @@
 }
 
 int uhd_device::writeSamples(std::vector<short *> &bufs, int len, bool *underrun,
-			     unsigned long long timestamp,bool isControl)
+			     unsigned long long timestamp)
 {
 	uhd::tx_metadata_t metadata;
 	metadata.has_time_spec = true;
@@ -814,12 +814,6 @@
 
 	*underrun = false;
 
-	// No control packets
-	if (isControl) {
-		LOGC(DDEV, ERROR) << "Control packets not supported";
-		return 0;
-	}
-
 	if (bufs.size() != chans) {
 		LOGC(DDEV, ALERT) << "Invalid channel combination " << bufs.size();
 		return -1;
diff --git a/Transceiver52M/device/uhd/UHDDevice.h b/Transceiver52M/device/uhd/UHDDevice.h
index 4809b25..1e66246 100644
--- a/Transceiver52M/device/uhd/UHDDevice.h
+++ b/Transceiver52M/device/uhd/UHDDevice.h
@@ -77,7 +77,7 @@
 			TIMESTAMP timestamp, bool *underrun);
 
 	int writeSamples(std::vector<short *> &bufs, int len, bool *underrun,
-			 TIMESTAMP timestamp, bool isControl);
+			 TIMESTAMP timestamp);
 
 	bool updateAlignment(TIMESTAMP timestamp);
 
diff --git a/Transceiver52M/device/usrp1/USRPDevice.cpp b/Transceiver52M/device/usrp1/USRPDevice.cpp
index 5eaca07..1a9a7e1 100644
--- a/Transceiver52M/device/usrp1/USRPDevice.cpp
+++ b/Transceiver52M/device/usrp1/USRPDevice.cpp
@@ -515,9 +515,8 @@
 #endif
 }
 
-int USRPDevice::writeSamples(std::vector<short *> &bufs, int len,
-                             bool *underrun, unsigned long long timestamp,
-                             bool isControl)
+int USRPDevice::writeSamplesControl(std::vector<short *> &bufs, int len,
+                             bool *underrun, unsigned long long timestamp, bool isControl)
 {
   writeLock.lock();
 
@@ -571,6 +570,12 @@
 #endif
 }
 
+int USRPDevice::writeSamples(std::vector<short *> &bufs, int len,
+                             bool *underrun, unsigned long long timestamp)
+{
+  return writeSamplesControl(bufs, len, underrun, timestamp, false);
+}
+
 bool USRPDevice::updateAlignment(TIMESTAMP timestamp)
 {
 #ifndef SWLOOPBACK
@@ -580,7 +585,7 @@
   bool tmpUnderrun;
 
   std::vector<short *> buf(1, data);
-  if (writeSamples(buf, 1, &tmpUnderrun, timestamp & 0x0ffffffffll, true)) {
+  if (writeSamplesControl(buf, 1, &tmpUnderrun, timestamp & 0x0ffffffffll, true)) {
     pingTimestamp = timestamp;
     return true;
   }
diff --git a/Transceiver52M/device/usrp1/USRPDevice.h b/Transceiver52M/device/usrp1/USRPDevice.h
index 0cf5ec3..a4a0886 100644
--- a/Transceiver52M/device/usrp1/USRPDevice.h
+++ b/Transceiver52M/device/usrp1/USRPDevice.h
@@ -82,6 +82,9 @@
   double rxGain;
   double txGain;
 
+  int writeSamplesControl(std::vector<short *> &bufs, int len, bool *underrun,
+                   TIMESTAMP timestamp = 0xffffffff, bool isControl = false);
+
 #ifdef SWLOOPBACK
   short loopbackBuffer[1000000];
   int loopbackBufferSize;
@@ -127,11 +130,10 @@
         @param len number of samples to write.
         @param underrun Set if USRP does not have data to transmit, e.g. data not being sent fast enough
         @param timestamp The timestamp of the first sample of the data buffer.
-        @param isControl Set if data is a control packet, e.g. a ping command
         @return The number of samples actually written
   */
   int writeSamples(std::vector<short *> &bufs, int len, bool *underrun,
-                   TIMESTAMP timestamp = 0xffffffff, bool isControl = false);
+                   TIMESTAMP timestamp = 0xffffffff);
 
   /** Update the alignment between the read and write timestamps */
   bool updateAlignment(TIMESTAMP timestamp);

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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I843384e24b76cdd28a95f9ee4e95e6157098e4a3
Gerrit-Change-Number: 17476
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/20200312/0911e733/attachment.htm>


More information about the gerrit-log mailing list