mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-16 18:38:32 +03:00
Reset the card after formatting and auto-detect
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
5
pySim.py
5
pySim.py
@@ -344,6 +344,9 @@ class Card(object):
|
|||||||
"""Converts integer MCC/MNC into 6 bytes for EF"""
|
"""Converts integer MCC/MNC into 6 bytes for EF"""
|
||||||
return swap_nibbles(lpad('%d' % mcc, 3) + lpad('%d' % mnc, 3))
|
return swap_nibbles(lpad('%d' % mcc, 3) + lpad('%d' % mnc, 3))
|
||||||
|
|
||||||
|
def reset(self):
|
||||||
|
self._sl.reset_card()
|
||||||
|
|
||||||
|
|
||||||
class _MagicSimBase(Card):
|
class _MagicSimBase(Card):
|
||||||
"""
|
"""
|
||||||
@@ -775,6 +778,7 @@ if __name__ == '__main__':
|
|||||||
card = kls.autodetect(sl)
|
card = kls.autodetect(sl)
|
||||||
if card:
|
if card:
|
||||||
print "Autodetected card type %s" % card.name
|
print "Autodetected card type %s" % card.name
|
||||||
|
card.reset()
|
||||||
break
|
break
|
||||||
|
|
||||||
if card is None:
|
if card is None:
|
||||||
@@ -792,6 +796,7 @@ if __name__ == '__main__':
|
|||||||
if opts.erase:
|
if opts.erase:
|
||||||
print "Formatting ..."
|
print "Formatting ..."
|
||||||
card.erase()
|
card.erase()
|
||||||
|
card.reset()
|
||||||
|
|
||||||
# Program it
|
# Program it
|
||||||
print "Programming ..."
|
print "Programming ..."
|
||||||
|
|||||||
Reference in New Issue
Block a user