Change in osmocom-bb[master]: trx_toolkit: fix encoding of TRXDv2 specific Power field

fixeria gerrit-no-reply at lists.osmocom.org
Wed Apr 14 02:30:38 UTC 2021


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/23745 )


Change subject: trx_toolkit: fix encoding of TRXDv2 specific Power field
......................................................................

trx_toolkit: fix encoding of TRXDv2 specific Power field

Change-Id: I482f72fd9305c51f43a0339d03904fb693d90ac9
Related: OS#4006, SYS#4895
---
M src/target/trx_toolkit/trxd_proto.py
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/45/23745/1

diff --git a/src/target/trx_toolkit/trxd_proto.py b/src/target/trx_toolkit/trxd_proto.py
index 80d8de8..545906f 100644
--- a/src/target/trx_toolkit/trxd_proto.py
+++ b/src/target/trx_toolkit/trxd_proto.py
@@ -99,8 +99,8 @@
 		return 1
 
 	def to_bytes(self, vals: dict) -> bytes:
-		blob = (vals['red'] & 0b1111) \
-		     | (abs(vals['scpir']) << 4) // 2 \
+		blob = ((vals['red'] // 2) & 0b1111) \
+		     | (((abs(vals['scpir']) // 2) & 0b111) << 4) \
 		     | (0x80 if (vals['scpir'] < 0) else 0x00)
 		return bytes((blob,))
 

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I482f72fd9305c51f43a0339d03904fb693d90ac9
Gerrit-Change-Number: 23745
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210414/d490a61d/attachment.htm>


More information about the gerrit-log mailing list