aboutsummaryrefslogtreecommitdiffstats
path: root/pySim-read.py
diff options
context:
space:
mode:
authorSupreeth Herle <herlesupreeth@gmail.com>2020-01-21 19:50:31 +0100
committerVadim Yanitskiy <axilirator@gmail.com>2020-02-15 03:25:47 +0700
commit6af4c21cdfd6cd594305be94b87975ecebb85560 (patch)
treeef468e92ff6323fedf017e26634ffe28ed13ff45 /pySim-read.py
parenta3bb334981b10706678a5ffda4d15395a8a1f3eb (diff)
pySim-read.py: print meaningful message when SPN is not set
Diffstat (limited to 'pySim-read.py')
-rwxr-xr-xpySim-read.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/pySim-read.py b/pySim-read.py
index 853e924..d753c8b 100755
--- a/pySim-read.py
+++ b/pySim-read.py
@@ -126,7 +126,9 @@ if __name__ == '__main__':
(res, sw) = scc.read_binary(EF['SPN'])
if sw == '9000':
spn_res = dec_spn(res)
- print("SPN: %s\nDisplay HPLMN: %s\nDisplay OPLMN: %s" % (spn_res[0], spn_res[1], spn_res[2],))
+ print("SPN: %s" % (spn_res[0] or "Not available"))
+ print("Display HPLMN: %s" % (spn_res[1],))
+ print("Display OPLMN: %s" % (spn_res[2],))
else:
print("SPN: Can't read, response code = %s" % (sw,))
except Exception as e: