kirr has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmocom-bb/+/40079?usp=email )
Change subject: trx_toolkit/data_msg: Push checking whether .burst is None from
Msg.gen_msg to TxMsg/RxMsg .append_burst_to
......................................................................
trx_toolkit/data_msg: Push checking whether .burst is None from Msg.gen_msg to TxMsg/RxMsg
.append_burst_to
TxMsg and RxMsg have different types for their bursts, so inside Msg
functions accessing .burst goes via py-level, while inside TxMsg/RxMsg
functions accessing .burst goes via C-level.
Change-Id: Ie3d38131db8964c7f134e03a9676b1e0e84be6ae
---
M src/target/trx_toolkit/data_msg.pyx
1 file changed, 5 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/79/40079/1
diff --git a/src/target/trx_toolkit/data_msg.pyx b/src/target/trx_toolkit/data_msg.pyx
index ac3dc49..34f6a12 100644
--- a/src/target/trx_toolkit/data_msg.pyx
+++ b/src/target/trx_toolkit/data_msg.pyx
@@ -260,8 +260,7 @@
self.append_hdr_to(buf)
# Generate burst
- if self.burst is not None:
- self.append_burst_to(buf)
+ self.append_burst_to(buf)
# This is a rudiment from (legacy) OpenBTS transceiver,
# some L1 implementations still expect two dummy bytes.
@@ -403,6 +402,8 @@
''' Generate message specific burst by appending it to buf.
'''
# Copy burst 'as is'
+ if self.burst is None:
+ return
return buf.extend(self.burst)
cdef parse_burst(self, bytearray burst):
@@ -727,6 +728,8 @@
# Convert soft-bits to unsigned soft-bits
l = PyByteArray_GET_SIZE(buf)
+ if self.burst is None:
+ return
PyByteArray_Resize(buf, l+len(self.burst))
Msg.__sbit2usbit(<int8_t*>self.burst.data.as_chars, len(self.burst),
<uint8_t*>&PyByteArray_AS_STRING(buf)[l])
--
To view, visit
https://gerrit.osmocom.org/c/osmocom-bb/+/40079?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ie3d38131db8964c7f134e03a9676b1e0e84be6ae
Gerrit-Change-Number: 40079
Gerrit-PatchSet: 1
Gerrit-Owner: kirr <kirr(a)nexedi.com>
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: osmith <osmith(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>