mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-29 00:39:07 +03:00
Move parsing of HPLMNAcT to generic Card class
Change-Id: I46c863c118dcbef89455c34289ed25e5a342f35b
This commit is contained in:
@@ -183,9 +183,9 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
# EF.HPLMNAcT
|
# EF.HPLMNAcT
|
||||||
try:
|
try:
|
||||||
(res, sw) = scc.read_binary(EF['HPLMNAcT'])
|
(res, sw) = card.read_hplmn_act()
|
||||||
if sw == '9000':
|
if sw == '9000':
|
||||||
print("HPLMNAcT:\n%s" % (format_xplmn_w_act(res)))
|
print("HPLMNAcT:\n%s" % (res))
|
||||||
else:
|
else:
|
||||||
print("HPLMNAcT: Can't read, response code = %s" % (sw,))
|
print("HPLMNAcT: Can't read, response code = %s" % (sw,))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
@@ -66,6 +66,13 @@ class Card(object):
|
|||||||
data, sw = self._scc.update_binary(EF['ACC'], lpad(acc, 4))
|
data, sw = self._scc.update_binary(EF['ACC'], lpad(acc, 4))
|
||||||
return sw
|
return sw
|
||||||
|
|
||||||
|
def read_hplmn_act(self):
|
||||||
|
(res, sw) = self._scc.read_binary(EF['HPLMNAcT'])
|
||||||
|
if sw == '9000':
|
||||||
|
return (format_xplmn_w_act(res), sw)
|
||||||
|
else:
|
||||||
|
return (None, sw)
|
||||||
|
|
||||||
def update_hplmn_act(self, mcc, mnc, access_tech='FFFF'):
|
def update_hplmn_act(self, mcc, mnc, access_tech='FFFF'):
|
||||||
"""
|
"""
|
||||||
Update Home PLMN with access technology bit-field
|
Update Home PLMN with access technology bit-field
|
||||||
|
|||||||
Reference in New Issue
Block a user