laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/34851?usp=email )
(
4 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: utils: Fix bertlv_encode_tag() for multi-byte tags
......................................................................
utils: Fix bertlv_encode_tag() for multi-byte tags
We used to support only single-byte tags in bertlv_encode_tag,
let's fix that. The easy option is to simply call bertlv_parse_tag,
as that already supported multi-byte tags.
Change-Id: If0bd9137883c4c8b01c4dfcbb53cabeee5c1ce2b
---
M pySim/utils.py
1 file changed, 28 insertions(+), 8 deletions(-)
Approvals:
fixeria: Looks good to me, but someone else must approve
Jenkins Builder: Verified
dexter: Looks good to me, approved
diff --git a/pySim/utils.py b/pySim/utils.py
index 6cacdaa..7459a3f 100644
--- a/pySim/utils.py
+++ b/pySim/utils.py
@@ -262,15 +262,22 @@
remainder = inp & ~ (inp << (remain_bits - bitcnt))
return outp, remainder
+ def count_int_bytes(inp: int) -> int:
+ """count the number of bytes require to represent the given integer."""
+ i = 1
+ inp = inp >> 8
+ while inp:
+ i += 1
+ inp = inp >> 8
+ return i
+
if isinstance(t, int):
- # FIXME: multiple byte tags
- tag = t & 0x1f
- constructed = True if t & 0x20 else False
- cls = t >> 6
- else:
- tag = t['tag']
- constructed = t['constructed']
- cls = t['class']
+ # first convert to a dict representation
+ tag_size = count_int_bytes(t)
+ t, remainder = bertlv_parse_tag(t.to_bytes(tag_size, 'big'))
+ tag = t['tag']
+ constructed = t['constructed']
+ cls = t['class']
if tag <= 30:
t = tag & 0x1f
if constructed:
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/34851?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: If0bd9137883c4c8b01c4dfcbb53cabeee5c1ce2b
Gerrit-Change-Number: 34851
Gerrit-PatchSet: 5
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/34848?usp=email )
(
5 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: pySim-shell: Add 'switch_channel' command
......................................................................
pySim-shell: Add 'switch_channel' command
We've already had the 'open_channel' and 'close_channel' commands,
which were sent to (and acknowledged by) the card. However,
those commands didn't affect the pySim-shell state, i.e. all
communication would still happen through the default channel '0'.
With this patch we introduce a 'switch_channel' command, using which
the user can determine which of the (previously opened) logical channels
shall be used by pySim-shell.
Change-Id: Ia76eb45c4925882ae6866e50b64d9610bd4d546d
Closes: OS#6230
---
M docs/shell.rst
M pySim-shell.py
2 files changed, 37 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
dexter: Looks good to me, approved
fixeria: Looks good to me, but someone else must approve
diff --git a/docs/shell.rst b/docs/shell.rst
index dea0bb4..51fd49e 100644
--- a/docs/shell.rst
+++ b/docs/shell.rst
@@ -199,6 +199,12 @@
:module: pySim-shell
:func: Iso7816Commands.close_chan_parser
+switch_channel
+~~~~~~~~~~~~~~
+.. argparse::
+ :module: pySim-shell
+ :func: Iso7816Commands.switch_chan_parser
+
TS 102 221 commands
-------------------
diff --git a/pySim-shell.py b/pySim-shell.py
index 8a1ad01..2f97389 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -963,6 +963,18 @@
# this is executed only in successful case, as unsuccessful raises exception
self._cmd.rs.del_lchan(opts.chan_nr)
+ switch_chan_parser = argparse.ArgumentParser()
+ switch_chan_parser.add_argument(
+ 'chan_nr', type=int, default=0, help='Channel Number')
+
+ @cmd2.with_argparser(switch_chan_parser)
+ def do_switch_channel(self, opts):
+ """Switch currently active logical channel."""
+ self._cmd.lchan._select_pre(self._cmd)
+ self._cmd.lchan = self._cmd.rs.lchan[opts.chan_nr]
+ self._cmd.lchan._select_post(self._cmd)
+ self._cmd.update_prompt()
+
def do_status(self, opts):
"""Perform the STATUS command."""
fcp_dec = self._cmd.lchan.status()
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/34848?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ia76eb45c4925882ae6866e50b64d9610bd4d546d
Gerrit-Change-Number: 34848
Gerrit-PatchSet: 6
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged
Attention is currently required from: dexter, osmith, pespin.
Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/34648?usp=email )
Change subject: pcuif_proto: signal BTS model via PCUIF
......................................................................
Patch Set 7:
(1 comment)
File src/common/pcu_sock.c:
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-12085):
https://gerrit.osmocom.org/c/osmo-bts/+/34648/comment/d867ea3e_37c79262
PS7, Line 248: return PCU_IF_BTS_MODEL_TRX;
code indent should use tabs where possible
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/34648?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ib51238a0e09d4484a539a7f822864189872698b6
Gerrit-Change-Number: 34648
Gerrit-PatchSet: 7
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 24 Oct 2023 15:23:00 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: dexter, osmith, pespin.
Hello Jenkins Builder, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-bts/+/34648?usp=email
to look at the new patch set (#7).
The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder
Change subject: pcuif_proto: signal BTS model via PCUIF
......................................................................
pcuif_proto: signal BTS model via PCUIF
At the moment the PCU has no way of knowing with which BTS model it is
used with. However, some BTS models may require slightly different
behaviour by the PCU, depending on which BTS model is used. So, lets add
an additional bts_model field to struct gsm_pcu_if_info_ind in order to
convey the exact BTS model to the PCU.
Related: OS#6191
Depends: osmo-pcu.git I48eb75f65ab54fdec41ef913e24c1f18cd4a4047
Change-Id: Ib51238a0e09d4484a539a7f822864189872698b6
---
M include/osmo-bts/pcuif_proto.h
M src/common/pcu_sock.c
2 files changed, 51 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/48/34648/7
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/34648?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ib51238a0e09d4484a539a7f822864189872698b6
Gerrit-Change-Number: 34648
Gerrit-PatchSet: 7
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: arehbein.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31878?usp=email )
Change subject: Make RLC timing data configurable
......................................................................
Patch Set 2:
(1 comment)
File src/osmo-bsc/net_init.c:
https://gerrit.osmocom.org/c/osmo-bsc/+/31878/comment/972c5b9b_d5c3c520
PS2, Line 51: { .T = 3142, .default_val = 20,
> > So we really need to add a osmo_tdef group per bts object. You can have a look at > asp->cfg. […]
Have a look also ag libosmo-sccp "inst->tdefs" inside osmo_sccp_instance_create(),
and related sccp_timer_cmd in sccp_vty.c
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31878?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I2c24110d8c977d6cc74c3c8e77bcc709ad9d2675
Gerrit-Change-Number: 31878
Gerrit-PatchSet: 2
Gerrit-Owner: arehbein <arehbein(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: arehbein <arehbein(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 24 Oct 2023 15:13:12 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: arehbein <arehbein(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment