aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xpySim-read.py4
-rw-r--r--pySim/cards.py7
2 files changed, 9 insertions, 2 deletions
diff --git a/pySim-read.py b/pySim-read.py
index 4446987..f54045b 100755
--- a/pySim-read.py
+++ b/pySim-read.py
@@ -183,9 +183,9 @@ if __name__ == '__main__':
# EF.HPLMNAcT
try:
- (res, sw) = scc.read_binary(EF['HPLMNAcT'])
+ (res, sw) = card.read_hplmn_act()
if sw == '9000':
- print("HPLMNAcT:\n%s" % (format_xplmn_w_act(res)))
+ print("HPLMNAcT:\n%s" % (res))
else:
print("HPLMNAcT: Can't read, response code = %s" % (sw,))
except Exception as e:
diff --git a/pySim/cards.py b/pySim/cards.py
index 55d1979..8081f87 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -66,6 +66,13 @@ class Card(object):
data, sw = self._scc.update_binary(EF['ACC'], lpad(acc, 4))
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'):
"""
Update Home PLMN with access technology bit-field