Change in osmocom-bb[master]: trx_toolkit/data_msg.py: fix: NOPE.ind also contains C/I filed

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/.

laforge gerrit-no-reply at lists.osmocom.org
Wed Nov 20 15:05:58 UTC 2019


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/16091 )

Change subject: trx_toolkit/data_msg.py: fix: NOPE.ind also contains C/I filed
......................................................................

trx_toolkit/data_msg.py: fix: NOPE.ind also contains C/I filed

Change-Id: I281fb7387a83fec7e097ebf8650c95713d3f70e9
---
M src/target/trx_toolkit/data_msg.py
1 file changed, 6 insertions(+), 9 deletions(-)

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



diff --git a/src/target/trx_toolkit/data_msg.py b/src/target/trx_toolkit/data_msg.py
index ec59b85..c96dddb 100644
--- a/src/target/trx_toolkit/data_msg.py
+++ b/src/target/trx_toolkit/data_msg.py
@@ -630,7 +630,8 @@
 		if self.toa256 < self.TOA256_MIN or self.toa256 > self.TOA256_MAX:
 			raise ValueError("ToA256 %d is out of range" % self.toa256)
 
-		if self.ver >= 0x01:
+		# Version specific parameters (omited for NOPE.ind)
+		if self.ver >= 0x01 and not self.nope_ind:
 			if type(self.mod_type) is not Modulation:
 				raise ValueError("Unknown Rx modulation type")
 
@@ -650,6 +651,8 @@
 			if self.tsc not in self.TSC_RANGE:
 				raise ValueError("TSC %d is out of range" % self.tsc)
 
+		# Version specific parameters (also present in NOPE.ind)
+		if self.ver >= 0x01:
 			if self.ci is None:
 				raise ValueError("C/I is not set")
 
@@ -779,10 +782,7 @@
 			buf.append(mts)
 
 			# C/I: Carrier-to-Interference ratio (in centiBels)
-			if not self.nope_ind:
-				buf += struct.pack(">h", self.ci)
-			else:
-				buf += bytearray(2)
+			buf += struct.pack(">h", self.ci)
 
 		return buf
 
@@ -799,10 +799,7 @@
 			self.parse_mts(hdr[8])
 
 			# C/I: Carrier-to-Interference ratio (in centiBels)
-			if not self.nope_ind:
-				self.ci = struct.unpack(">h", hdr[9:11])[0]
-			else:
-				self.ci = None
+			self.ci = struct.unpack(">h", hdr[9:11])[0]
 
 	# Generates message specific burst
 	def gen_burst(self):

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I281fb7387a83fec7e097ebf8650c95713d3f70e9
Gerrit-Change-Number: 16091
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.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/20191120/f7f40d37/attachment.htm>


More information about the gerrit-log mailing list