Change in pysim[master]: Provided 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/.

herlesupreeth gerrit-no-reply at lists.osmocom.org
Tue Jan 21 18:50:44 UTC 2020


herlesupreeth has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/16981 )


Change subject: Provided meaningful message when SPN is not set
......................................................................

Provided 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, 6 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/81/16981/1

diff --git a/pySim-read.py b/pySim-read.py
index d9ff673..34ff576 100755
--- a/pySim-read.py
+++ b/pySim-read.py
@@ -152,7 +152,10 @@
 		(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],))
+			if spn_res[0] != '':
+				print("SPN: %s\nDisplay HPLMN: %s\nDisplay OPLMN: %s" % (spn_res[0], spn_res[1], spn_res[2],))
+			else:
+				print("SPN: %s\nDisplay HPLMN: %s\nDisplay OPLMN: %s" % ("Not available", spn_res[1], 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 fbca247..14a1b9c 100644
--- a/pysim-testdata/sysmoISIM-SJA2.ok
+++ b/pysim-testdata/sysmoISIM-SJA2.ok
@@ -10,7 +10,7 @@
 Service 34 - Enabled Services Table: True
 Service 35 - APN Control List (ACL): False
 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 28a9237..b26433b 100644
--- a/pysim-testdata/sysmosim-gr1.ok
+++ b/pysim-testdata/sysmosim-gr1.ok
@@ -7,7 +7,7 @@
 Service 34 - Enabled Services Table: False
 Service 35 - APN Control List (ACL): False
 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: 1
Gerrit-Owner: herlesupreeth <herlesupreeth at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200121/841fcc09/attachment.htm>


More information about the gerrit-log mailing list