mirror of https://gerrit.osmocom.org/pysim
filesystem: fix reset mechanism
Currently we call the reset_card and get_atr methods directly at the transport layer via the private _scc and _tp object of the card. This is a violation. Fix and use the reset methods that are already in the SimCard object. Change-Id: I0e9d2a62a42a7387e7ca69d2ae830782a61aed89
This commit is contained in:
parent
30b225f3bf
commit
946226a5d1
|
@ -60,7 +60,11 @@ class SimCard(object):
|
||||||
self._aids = []
|
self._aids = []
|
||||||
|
|
||||||
def reset(self):
|
def reset(self):
|
||||||
self._scc.reset_card()
|
rc = self._scc.reset_card()
|
||||||
|
if rc is 1:
|
||||||
|
return self._scc.get_atr()
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
def erase(self):
|
def erase(self):
|
||||||
print("warning: erasing is not supported for specified card type!")
|
print("warning: erasing is not supported for specified card type!")
|
||||||
|
|
|
@ -1068,8 +1068,7 @@ class RuntimeState(object):
|
||||||
Args:
|
Args:
|
||||||
cmd_app : Command Application State (for unregistering old file commands)
|
cmd_app : Command Application State (for unregistering old file commands)
|
||||||
"""
|
"""
|
||||||
self.card._scc._tp.reset_card()
|
atr = i2h(self.card.reset())
|
||||||
atr = i2h(self.card._scc._tp.get_atr())
|
|
||||||
# select MF to reset internal state and to verify card really works
|
# select MF to reset internal state and to verify card really works
|
||||||
self.select('MF', cmd_app)
|
self.select('MF', cmd_app)
|
||||||
return atr
|
return atr
|
||||||
|
|
Loading…
Reference in New Issue