Move parsing of MSISDN to generic Card class
Change-Id: I5b726bc0dc8c8e5eb42f209b1fe0f35a46ac91be
This commit is contained in:
@@ -200,13 +200,11 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
# EF.MSISDN
|
# EF.MSISDN
|
||||||
try:
|
try:
|
||||||
# print(scc.record_size(['3f00', '7f10', '6f40']))
|
(res, sw) = card.read_msisdn()
|
||||||
(res, sw) = scc.read_record(['3f00', '7f10', '6f40'], 1)
|
|
||||||
if sw == '9000':
|
if sw == '9000':
|
||||||
res_dec = dec_msisdn(res)
|
# (npi, ton, msisdn) = res
|
||||||
if res_dec is not None:
|
if res is not None:
|
||||||
# (npi, ton, msisdn) = res_dec
|
print("MSISDN (NPI=%d ToN=%d): %s" % res)
|
||||||
print("MSISDN (NPI=%d ToN=%d): %s" % res_dec)
|
|
||||||
else:
|
else:
|
||||||
print("MSISDN: Not available")
|
print("MSISDN: Not available")
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -181,6 +181,13 @@ class Card(object):
|
|||||||
else:
|
else:
|
||||||
return (None, sw)
|
return (None, sw)
|
||||||
|
|
||||||
|
def read_msisdn(self):
|
||||||
|
(res, sw) = self._scc.read_record(EF['MSISDN'], 1)
|
||||||
|
if sw == '9000':
|
||||||
|
return (dec_msisdn(res), sw)
|
||||||
|
else:
|
||||||
|
return (None, sw)
|
||||||
|
|
||||||
# Read the (full) AID for either ISIM or USIM application
|
# Read the (full) AID for either ISIM or USIM application
|
||||||
def read_aid(self, isim = False):
|
def read_aid(self, isim = False):
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user