laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/34848?usp=email )
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(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/48/34848/1
diff --git a/docs/shell.rst b/docs/shell.rst
index 73b988a..2c3d84d 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: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/34844?usp=email )
Change subject: pySim-shell: Create/delete RuntimeLchan objects on open/close of channel
......................................................................
pySim-shell: Create/delete RuntimeLchan objects on open/close of channel
We already have the open channel and close_channel commands in
pySim-shell. They are sent to the card and acknowledged, respectively.
We also already do have code that can track multiple different logical
channels (the rs.lchan array). However, this is currently only used by
pySim-trace, and not by pySim-shell. Let's change that.
Change-Id: Idacee2dc57e8afe85c79bc85b259064e7f5b83a2
Related: OS#6230
---
M pySim-shell.py
1 file changed, 21 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/44/34844/1
diff --git a/pySim-shell.py b/pySim-shell.py
index a79949c..867795c 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -948,6 +948,8 @@
"""Open a logical channel."""
(data, sw) = self._cmd.card._scc.manage_channel(
mode='open', lchan_nr=opts.chan_nr)
+ # this is executed only in successful case, as unsuccessful raises exception
+ self._cmd.lchan.add_lchan(opts.chan_nr)
close_chan_parser = argparse.ArgumentParser()
close_chan_parser.add_argument(
@@ -958,6 +960,8 @@
"""Close a logical channel."""
(data, sw) = self._cmd.card._scc.manage_channel(
mode='close', lchan_nr=opts.chan_nr)
+ # this is executed only in successful case, as unsuccessful raises exception
+ self._cmd.rs.del_lchan(opts.chan_nr)
def do_status(self, opts):
"""Perform the STATUS command."""
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/34844?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: Idacee2dc57e8afe85c79bc85b259064e7f5b83a2
Gerrit-Change-Number: 34844
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
Attention is currently required from: osmith.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34839?usp=email )
Change subject: ggsn: log start of test in SUT
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34839?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I2baccc2b49e8bcbf0d1ca6dae41624b2d18fc0fa
Gerrit-Change-Number: 34839
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Comment-Date: Sat, 21 Oct 2023 04:35:54 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment