Change in ...osmo-trx[master]: Transceiver: Move nbits calculation to pullRadioVector()
pespin
gerrit-no-reply at lists.osmocom.org
Fri Jun 28 15:27:18 UTC 2019
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-trx/+/14631
Change subject: Transceiver: Move nbits calculation to pullRadioVector()
......................................................................
Transceiver: Move nbits calculation to pullRadioVector()
That's were all the filling logic happens, while in driveReceiveFIFO we
mostly want to take the burst, generate a message and sent it over the
socket.
Take the chance to use EDGE_BURST_NBITS instead of gSlotLen*3 (while
keeping that formula in the comment) which makes it easier to understand
for casual reader.
Change-Id: I4a8c6c1db0474461d1055857f2e0af7aba04ae32
---
M Transceiver52M/Transceiver.cpp
M Transceiver52M/Transceiver.h
2 files changed, 11 insertions(+), 11 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/31/14631/1
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index 08b9e4f..9a376ab 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -647,6 +647,12 @@
bi->toa = toa;
bi->rxBurst = demodAnyBurst(*burst, mSPSRx, amp, toa, type);
+ /* EDGE demodulator returns 444 (gSlotLen * 3) bits */
+ if (bi->rxBurst->size() == EDGE_BURST_NBITS)
+ bi->nbits = EDGE_BURST_NBITS;
+ else /* size() here is actually gSlotLen + 8, due to guard periods */
+ bi->nbits = gSlotLen;
+
delete radio_burst;
return true;
}
@@ -921,7 +927,6 @@
{
double dBm; // in dBm
int TOAint; // in 1/256 symbols
- unsigned nbits = gSlotLen;
struct trx_ul_burst_ind bi;
@@ -931,18 +936,12 @@
// Convert -1..+1 soft bits to 0..1 soft bits
vectorSlicer(bi.rxBurst);
- /*
- * EDGE demodulator returns 444 (148 * 3) bits
- */
- if (bi.rxBurst->size() == gSlotLen * 3)
- nbits = gSlotLen * 3;
-
dBm = bi.rssi + rssiOffset;
logRxBurst(chan, &bi, dBm);
TOAint = (int) (bi.toa * 256.0 + 0.5); // round to closest integer
- char burstString[nbits + 10];
+ char burstString[bi.nbits + 10];
struct trxd_hdr_v0* pkt = (struct trxd_hdr_v0*)burstString;
pkt->common.tn = bi.burstTime.TN();
osmo_store32be(bi.burstTime.FN(), &pkt->common.fn);
@@ -950,13 +949,13 @@
osmo_store16be(TOAint, &pkt->v0.toa);
SoftVector::iterator burstItr = bi.rxBurst->begin();
- for (unsigned i = 0; i < nbits; i++)
+ for (unsigned i = 0; i < bi.nbits; i++)
pkt->soft_bits[i] = (char) round((*burstItr++) * 255.0);
- pkt->soft_bits[nbits] = '\0';
+ pkt->soft_bits[bi.nbits] = '\0';
delete bi.rxBurst;
- mDataSockets[chan]->write(burstString, sizeof(struct trxd_hdr_v0) + nbits + 1);
+ mDataSockets[chan]->write(burstString, sizeof(struct trxd_hdr_v0) + bi.nbits + 1);
}
void Transceiver::driveTxFIFO()
diff --git a/Transceiver52M/Transceiver.h b/Transceiver52M/Transceiver.h
index 5ef6bbb..935be7c 100644
--- a/Transceiver52M/Transceiver.h
+++ b/Transceiver52M/Transceiver.h
@@ -37,6 +37,7 @@
struct trx_ul_burst_ind {
SoftVector *rxBurst;
+ unsigned nbits; // number of symbols per slot in rxBurst, not counting guard periods
GSM::Time burstTime;
double rssi; // in dBFS
double toa; // in symbols
--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/14631
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I4a8c6c1db0474461d1055857f2e0af7aba04ae32
Gerrit-Change-Number: 14631
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/20190628/04ffd4bf/attachment-0001.html>
More information about the gerrit-log
mailing list