diff options
author | Harald Welte <laforge@osmocom.org> | 2021-04-10 18:39:32 +0200 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2021-04-11 12:20:29 +0200 |
commit | 703f933b40610ab30eb53368609b42ace4def200 (patch) | |
tree | 3bcf3c40498d6ca566675372746978fa8ca0471a /pySim-shell.py | |
parent | a463161ae22bb111dcc8c9fc8a9b17a78f6a3121 (diff) |
pySim-shell: Add open_channel + close_channel commands
Change-Id: I53d9d7f7720eb5f10956bff74ea7ba9fd3b3bd19
Diffstat (limited to 'pySim-shell.py')
-rwxr-xr-x | pySim-shell.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/pySim-shell.py b/pySim-shell.py index b2ccb9a..132733d 100755 --- a/pySim-shell.py +++ b/pySim-shell.py @@ -413,6 +413,23 @@ class Iso7816Commands(CommandSet): fid = self._cmd.rs.selected_file.fid (data, sw) = self._cmd.card._scc.activate_file(fid) + open_chan_parser = argparse.ArgumentParser() + open_chan_parser.add_argument('chan_nr', type=int, default=0, help='Channel Number') + + @cmd2.with_argparser(open_chan_parser) + def do_open_channel(self, opts): + """Open a logical channel.""" + (data, sw) = self._cmd.card._scc.manage_channel(mode='open', lchan_nr=opts.chan_nr) + + close_chan_parser = argparse.ArgumentParser() + close_chan_parser.add_argument('chan_nr', type=int, default=0, help='Channel Number') + + @cmd2.with_argparser(close_chan_parser) + def do_close_channel(self, opts): + """Close a logical channel.""" + (data, sw) = self._cmd.card._scc.manage_channel(mode='close', lchan_nr=opts.chan_nr) + + def parse_options(): parser = OptionParser(usage="usage: %prog [options]") |