laforge has submitted this change. ( 
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(-)

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




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 <lafo...@osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanits...@sysmocom.de>
Gerrit-Reviewer: laforge <lafo...@osmocom.org>
Gerrit-MessageType: merged

Reply via email to