diff --git a/pySim-shell.py b/pySim-shell.py index 2eb37ea7..e99c3659 100755 --- a/pySim-shell.py +++ b/pySim-shell.py @@ -265,10 +265,8 @@ Online manual available at https://downloads.osmocom.org/docs/pysim/master/html/ @cmd2.with_category(CUSTOM_CATEGORY) def do_reset(self, opts): """Reset the Card.""" - atr = self.card.reset() - if self.lchan and self.lchan.scc.scp: - self.lchan.scc.scp = None - self.poutput('Card ATR: %s' % i2h(atr)) + atr = self.rs.reset(self) + self.poutput('Card ATR: %s' % atr) self.update_prompt() class InterceptStderr(list): diff --git a/pySim/runtime.py b/pySim/runtime.py index a56df4d1..b7292461 100644 --- a/pySim/runtime.py +++ b/pySim/runtime.py @@ -134,10 +134,13 @@ class RuntimeState: """ # delete all lchan != 0 (basic lchan) for lchan_nr in list(self.lchan.keys()): + self.lchan[lchan_nr].scc.scp = None if lchan_nr == 0: continue del self.lchan[lchan_nr] atr = i2h(self.card.reset()) + if cmd_app: + cmd_app.lchan = self.lchan[0] # select MF to reset internal state and to verify card really works self.lchan[0].select('MF', cmd_app) self.lchan[0].selected_adf = None