shell: Add 'reset' command to reset the card

At some points during an interactive session or a script one may want
to reset the card.

Change-Id: I992eb3e0ed52f7941a5fb44f28a42e22ebd49301
This commit is contained in:
Harald Welte
2021-05-03 23:17:29 +02:00
parent 917d98c1a5
commit daf2b392f0
3 changed files with 24 additions and 1 deletions

View File

@@ -313,6 +313,12 @@ class PySimCommands(CommandSet):
elif context['DF_SKIP']:
raise RuntimeError("unable to export %i dedicated files(s)" % context['ERR'])
def do_reset(self, opts):
"""Reset the Card."""
atr = self._cmd.rs.reset(self._cmd)
self._cmd.poutput('Card ATR: %s' % atr)
self._cmd.update_prompt()
@with_default_category('ISO7816 Commands')
class Iso7816Commands(CommandSet):