aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2009-12-27 10:28:47 +0100
committerSylvain Munaut <tnt@246tNt.com>2009-12-27 10:28:47 +0100
commit36f7a2d60be6bb14a888324afb48f1f0e6c0d840 (patch)
tree97e8cf63c2ee9bca150835a09cc40ab47452bed2
parent995c398c132de922d8970e94eb8741fe135ebc9d (diff)
Reset the card after formatting and auto-detect
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
-rwxr-xr-xpySim.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/pySim.py b/pySim.py
index 4c2ee85..2178cbd 100755
--- a/pySim.py
+++ b/pySim.py
@@ -344,6 +344,9 @@ class Card(object):
"""Converts integer MCC/MNC into 6 bytes for EF"""
return swap_nibbles(lpad('%d' % mcc, 3) + lpad('%d' % mnc, 3))
+ def reset(self):
+ self._sl.reset_card()
+
class _MagicSimBase(Card):
"""
@@ -775,6 +778,7 @@ if __name__ == '__main__':
card = kls.autodetect(sl)
if card:
print "Autodetected card type %s" % card.name
+ card.reset()
break
if card is None:
@@ -792,6 +796,7 @@ if __name__ == '__main__':
if opts.erase:
print "Formatting ..."
card.erase()
+ card.reset()
# Program it
print "Programming ..."