mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-31 01:13:17 +03:00
Move parsing of OPLMNwAcT to generic Card class
Change-Id: I8050bd103a7085b2631ddc4e567d15e05f9428f2
This commit is contained in:
@@ -173,9 +173,9 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
# EF.OPLMNwAcT
|
# EF.OPLMNwAcT
|
||||||
try:
|
try:
|
||||||
(res, sw) = scc.read_binary(EF['OPLMNwAcT'])
|
(res, sw) = card.read_oplmn_act()
|
||||||
if sw == '9000':
|
if sw == '9000':
|
||||||
print("OPLMNwAcT:\n%s" % (format_xplmn_w_act(res)))
|
print("OPLMNwAcT:\n%s" % (res))
|
||||||
else:
|
else:
|
||||||
print("OPLMNwAcT: Can't read, response code = %s" % (sw,))
|
print("OPLMNwAcT: Can't read, response code = %s" % (sw,))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
@@ -84,6 +84,13 @@ class Card(object):
|
|||||||
data, sw = self._scc.update_binary(EF['HPLMNwAcT'], content + 'ffffff0000' * (size // 5 - 1))
|
data, sw = self._scc.update_binary(EF['HPLMNwAcT'], content + 'ffffff0000' * (size // 5 - 1))
|
||||||
return sw
|
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'):
|
def update_oplmn_act(self, mcc, mnc, access_tech='FFFF'):
|
||||||
"""
|
"""
|
||||||
See note in update_hplmn_act()
|
See note in update_hplmn_act()
|
||||||
|
|||||||
Reference in New Issue
Block a user