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/.
Vadim Yanitskiy gerrit-no-reply at lists.osmocom.orgVadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/12342 Change subject: trx_toolkit/data_msg.py: add optional legacy message coding flag ...................................................................... trx_toolkit/data_msg.py: add optional legacy message coding flag Some transceivers (e.g. OsmoTRX) have inherited a rudiment from OpenBTS - two dummy bytes at the end of TRX2L1 messages. Despite they are absolutely useless, some L1 implementations, such as trxcon and OpenBTS, still do expect them when checking the message length. Let's add an optional (disabled by default) argument to gen_msg(), that would enable adding those two dummy bytes. Change-Id: I0cf1314c399411886420176704cadd6e6d84787f --- M src/target/trx_toolkit/data_msg.py 1 file changed, 14 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/42/12342/1 diff --git a/src/target/trx_toolkit/data_msg.py b/src/target/trx_toolkit/data_msg.py index bbc9d93..62fd29b 100644 --- a/src/target/trx_toolkit/data_msg.py +++ b/src/target/trx_toolkit/data_msg.py @@ -152,7 +152,7 @@ return struct.unpack(">L", buf)[0] # Generates a TRX DATA message - def gen_msg(self): + def gen_msg(self, legacy = False): # Validate all the fields if not self.validate(): raise ValueError("Message incomplete or incorrect") @@ -174,6 +174,11 @@ # Generate burst buf += self.gen_burst() + # This is a rudiment from (legacy) OpenBTS transceiver, + # some L1 implementations still expect two dummy bytes. + if legacy: + buf += bytearray(2) + return buf # Parses a TRX DATA message @@ -461,6 +466,9 @@ l12trx_raw = msg_l12trx_ref.gen_msg() trx2l1_raw = msg_trx2l1_ref.gen_msg() + # Encode a TRX2L1 message in legacy mode + trx2l1_raw_legacy = msg_trx2l1_ref.gen_msg(legacy = True) + log.info("Parsing generated messages back") # Parse generated DATA messages @@ -469,11 +477,16 @@ msg_l12trx_dec.parse_msg(l12trx_raw) msg_trx2l1_dec.parse_msg(trx2l1_raw) + # Parse generated TRX2L1 message in legacy mode + msg_trx2l1_legacy_dec = DATAMSG_TRX2L1() + msg_trx2l1_legacy_dec.parse_msg(trx2l1_raw_legacy) + log.info("Comparing decoded messages with the reference") # Compare bursts assert(msg_l12trx_dec.burst == burst_l12trx_ref) assert(msg_trx2l1_dec.burst == burst_trx2l1_ref) + assert(msg_trx2l1_legacy_dec.burst == burst_trx2l1_ref) log.info("Compare bursts: OK") -- To view, visit https://gerrit.osmocom.org/12342 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0cf1314c399411886420176704cadd6e6d84787f Gerrit-Change-Number: 12342 Gerrit-PatchSet: 1 Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181218/787378cf/attachment.htm>