Move parsing of OPLMNwAcT to generic Card class

Change-Id: I8050bd103a7085b2631ddc4e567d15e05f9428f2
This commit is contained in:
Supreeth Herle 2020-03-19 12:43:11 +01:00
parent 140844052a
commit 1757b263bf
2 changed files with 9 additions and 2 deletions

View File

@ -173,9 +173,9 @@ if __name__ == '__main__':
# EF.OPLMNwAcT
try:
(res, sw) = scc.read_binary(EF['OPLMNwAcT'])
(res, sw) = card.read_oplmn_act()
if sw == '9000':
print("OPLMNwAcT:\n%s" % (format_xplmn_w_act(res)))
print("OPLMNwAcT:\n%s" % (res))
else:
print("OPLMNwAcT: Can't read, response code = %s" % (sw,))
except Exception as e:

View File

@ -84,6 +84,13 @@ class Card(object):
data, sw = self._scc.update_binary(EF['HPLMNwAcT'], content + 'ffffff0000' * (size // 5 - 1))
return sw
def read_oplmn_act(self):
(res, sw) = self._scc.read_binary(EF['OPLMNwAcT'])
if sw == '9000':
return (format_xplmn_w_act(res), sw)
else:
return (None, sw)
def update_oplmn_act(self, mcc, mnc, access_tech='FFFF'):
"""
See note in update_hplmn_act()