Change in ...osmo-trx[master]: Transceiver: Support pulling idle frames in pullRadioVector()

pespin gerrit-no-reply at lists.osmocom.org
Sun Jul 7 14:48:33 UTC 2019


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

Change subject: Transceiver: Support pulling idle frames in pullRadioVector()
......................................................................

Transceiver: Support pulling idle frames in pullRadioVector()

This logic will be used once we support TRXDv1, where idle indications
are sent through the socket.

Related: OS#4006
Change-Id: I46404f6e4055b6d3af3afffb0dfe4a19502917aa
---
M Transceiver52M/Transceiver.cpp
M Transceiver52M/Transceiver.h
2 files changed, 20 insertions(+), 11 deletions(-)

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



diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index 92d4061..4462cdd 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -591,8 +591,6 @@
 
   /* Set time and determine correlation type */
   burstTime = radio_burst->getTime();
-  bi->fn = burstTime.FN();
-  bi->tn = burstTime.TN();
   CorrType type = expectedCorrType(burstTime, chan);
 
   /* Enable 8-PSK burst detection if EDGE is enabled */
@@ -612,6 +610,15 @@
     return false;
   }
 
+  /* Initialize struct bi */
+  bi->nbits = 0;
+  bi->fn = burstTime.FN();
+  bi->tn = burstTime.TN();
+  bi->rssi = 0.0;
+  bi->toa = 0.0;
+  bi->noise = 0.0;
+  bi->idle = false;
+
   /* Select the diversity channel with highest energy */
   for (size_t i = 0; i < radio_burst->chans(); i++) {
     float pow = energyDetect(*radio_burst->getVector(i), 20 * mSPSRx);
@@ -624,8 +631,7 @@
 
   if (max_i < 0) {
     LOG(ALERT) << "Received empty burst";
-    delete radio_burst;
-    return false;
+    goto ret_idle;
   }
 
   /* Average noise on diversity paths and update global levels */
@@ -641,10 +647,8 @@
   bi->rssi = 20.0 * log10(rxFullScale / avg) + rssiOffset;
   bi->noise = 20.0 * log10(rxFullScale / state->mNoiseLev) + rssiOffset;
 
-  if (type == IDLE) {
-    delete radio_burst;
-    return false;
-  }
+  if (type == IDLE)
+    goto ret_idle;
 
   max_toa = (type == RACH || type == EXT_RACH) ?
             mMaxExpectedDelayAB : mMaxExpectedDelayNB;
@@ -656,8 +660,7 @@
       LOG(WARNING) << "Clipping detected on received RACH or Normal Burst";
     else if (rc != SIGERR_NONE)
       LOG(WARNING) << "Unhandled RACH or Normal Burst detection error";
-    delete radio_burst;
-    return false;
+    goto ret_idle;
   }
 
   type = (CorrType) rc;
@@ -676,6 +679,11 @@
   delete rxBurst;
   delete radio_burst;
   return true;
+
+ret_idle:
+  bi->idle = true;
+  delete radio_burst;
+  return false;
 }
 
 void Transceiver::reset()
@@ -968,7 +976,7 @@
 
   struct trx_ul_burst_ind bi;
 
-  if (!pullRadioVector(chan, &bi))
+  if (!pullRadioVector(chan, &bi) || bi.idle)
         return;
 
   logRxBurst(chan, &bi);
diff --git a/Transceiver52M/Transceiver.h b/Transceiver52M/Transceiver.h
index e4d0440..a66c962 100644
--- a/Transceiver52M/Transceiver.h
+++ b/Transceiver52M/Transceiver.h
@@ -44,6 +44,7 @@
         double rssi; // in dBFS
         double toa;  // in symbols
         double noise; // noise level in dBFS
+        bool idle; // true if no valid burst is included
 };
 
 class Transceiver;

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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I46404f6e4055b6d3af3afffb0dfe4a19502917aa
Gerrit-Change-Number: 14664
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
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/20190707/0df0a700/attachment.html>


More information about the gerrit-log mailing list