laforge submitted this change.

View Change


Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified
pySim-shell: Permit 'reset' command also in unqeuipped stage

If we are not 'equipped' as we could not detect any known applications
on the card, we used to only permit the 'apdu' command. However, we
should also permit the 'reset' command, as it also is something that's
possible with ever card, even of unknown types.

Change-Id: I23199da727973d7095ac18031f49e1e8423aa287
---
M pySim-shell.py
1 file changed, 21 insertions(+), 6 deletions(-)

diff --git a/pySim-shell.py b/pySim-shell.py
index c645403..5b80588 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -254,6 +254,13 @@
if not sw_match(sw, opts.expect_sw):
raise SwMatchError(sw, opts.expect_sw)

+ @cmd2.with_category(CUSTOM_CATEGORY)
+ def do_reset(self, opts):
+ """Reset the Card."""
+ atr = self.card.reset()
+ self.poutput('Card ATR: %s' % i2h(atr))
+ self.update_prompt()
+
class InterceptStderr(list):
def __init__(self):
self._stderr_backup = sys.stderr
@@ -702,12 +709,6 @@
raise RuntimeError(
"unable to export %i dedicated files(s)%s" % (context['ERR'], exception_str_add))

- def do_reset(self, opts):
- """Reset the Card."""
- atr = self._cmd.card.reset()
- self._cmd.poutput('Card ATR: %s' % i2h(atr))
- self._cmd.update_prompt()
-
def do_desc(self, opts):
"""Display human readable file description for the currently selected file"""
desc = self._cmd.lchan.selected_file.desc

To view, visit change 35595. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I23199da727973d7095ac18031f49e1e8423aa287
Gerrit-Change-Number: 35595
Gerrit-PatchSet: 4
Gerrit-Owner: laforge <laforge@osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-MessageType: merged