Change in pysim[master]: pySim-read.py: print meaningful message when SPN is not set

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Sat Feb 15 19:11:35 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/16981 )

Change subject: pySim-read.py: print meaningful message when SPN is not set
......................................................................

pySim-read.py: print meaningful message when SPN is not set

Change-Id: I1d98520f33a8564c7d69f50a0811204f138f9dca
---
M pySim-read.py
M pysim-testdata/sysmoISIM-SJA2.ok
M pysim-testdata/sysmosim-gr1.ok
3 files changed, 5 insertions(+), 3 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



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 @@
 		(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:
diff --git a/pysim-testdata/sysmoISIM-SJA2.ok b/pysim-testdata/sysmoISIM-SJA2.ok
index 7346134..77c4878 100644
--- a/pysim-testdata/sysmoISIM-SJA2.ok
+++ b/pysim-testdata/sysmoISIM-SJA2.ok
@@ -3,7 +3,7 @@
 ICCID: 8988211900000000004
 IMSI: 001010000000102
 SMSP: ffffffffffffffffffffffffffffffffffffffffffffffffe1ffffffffffffffffffffffff0581005155f5ffffffffffff000000
-SPN: 
+SPN: Not available
 Display HPLMN: False
 Display OPLMN: False
 PLMNsel: fff11fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
diff --git a/pysim-testdata/sysmosim-gr1.ok b/pysim-testdata/sysmosim-gr1.ok
index b306f4d..f7df5cf 100644
--- a/pysim-testdata/sysmosim-gr1.ok
+++ b/pysim-testdata/sysmosim-gr1.ok
@@ -3,7 +3,7 @@
 ICCID: 1122334455667788990
 IMSI: 001010000000102
 SMSP: ffffffffffffffffffffffffe1ffffffffffffffffffffffff0581005155f5ffffffffffff000000
-SPN: 
+SPN: Not available
 Display HPLMN: False
 Display OPLMN: False
 PLMNsel: fff11fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff

-- 
To view, visit https://gerrit.osmocom.org/c/pysim/+/16981
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I1d98520f33a8564c7d69f50a0811204f138f9dca
Gerrit-Change-Number: 16981
Gerrit-PatchSet: 5
Gerrit-Owner: herlesupreeth <herlesupreeth at gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-CC: fixeria <axilirator at gmail.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200215/34e62fc3/attachment.htm>


More information about the gerrit-log mailing list