mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-25 06:48:33 +03:00
pySim-shell: fix reset command for no-profile mode
There are situations where no card profile can be determined. In this case no RuntimeState will be present. This is in particular the case when pySim-shell is used on a card that is not provisioned/initialized yet. In those cases we have to go the direct route and reset the card directly. Related: OS#6367 Change-Id: I27bf9fdb131d8bdeba07f4dfd2b76b38f9bfdd17
This commit is contained in:
@@ -274,7 +274,12 @@ Online manual available at https://downloads.osmocom.org/docs/pysim/master/html/
|
|||||||
@cmd2.with_category(CUSTOM_CATEGORY)
|
@cmd2.with_category(CUSTOM_CATEGORY)
|
||||||
def do_reset(self, opts):
|
def do_reset(self, opts):
|
||||||
"""Reset the Card."""
|
"""Reset the Card."""
|
||||||
atr = self.rs.reset(self)
|
if self.rs is None:
|
||||||
|
# In case no runtime state is available we go the direct route
|
||||||
|
self.card._scc.reset_card()
|
||||||
|
atr = b2h(self.card._scc.get_atr())
|
||||||
|
else:
|
||||||
|
atr = self.rs.reset(self)
|
||||||
self.poutput('Card ATR: %s' % atr)
|
self.poutput('Card ATR: %s' % atr)
|
||||||
self.update_prompt()
|
self.update_prompt()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user