Change in pysim[master]: Move parsing of OPLMNwAcT to generic Card class

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
Mon Mar 30 08:52:43 UTC 2020


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


Change subject: Move parsing of OPLMNwAcT to generic Card class
......................................................................

Move parsing of OPLMNwAcT to generic Card class

Change-Id: I8050bd103a7085b2631ddc4e567d15e05f9428f2
---
M pySim-read.py
M pySim/cards.py
2 files changed, 9 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/62/17662/1

diff --git a/pySim-read.py b/pySim-read.py
index ba4e882..0da00b5 100755
--- a/pySim-read.py
+++ b/pySim-read.py
@@ -173,9 +173,9 @@
 
 	# EF.OPLMNwAcT
 	try:
-		(res, sw) = scc.read_binary(EF['OPLMNwAcT'])
+		(res, sw) = card.read_oplmn_act()
 		if sw == '9000':
-			print("OPLMNwAcT:\n%s" % (format_xplmn_w_act(res)))
+			print("OPLMNwAcT:\n%s" % (res))
 		else:
 			print("OPLMNwAcT: Can't read, response code = %s" % (sw,))
 	except Exception as e:
diff --git a/pySim/cards.py b/pySim/cards.py
index b666f65..ac9d993 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -84,6 +84,13 @@
 		data, sw = self._scc.update_binary(EF['HPLMNwAcT'], content + 'ffffff0000' * (size // 5 - 1))
 		return sw
 
+	def read_oplmn_act(self):
+		(res, sw) = self._scc.read_binary(EF['OPLMNwAcT'])
+		if sw == '9000':
+			return (format_xplmn_w_act(res), sw)
+		else:
+			return (None, sw)
+
 	def update_oplmn_act(self, mcc, mnc, access_tech='FFFF'):
 		"""
 		See note in update_hplmn_act()

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I8050bd103a7085b2631ddc4e567d15e05f9428f2
Gerrit-Change-Number: 17662
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/20200330/26a74431/attachment.htm>


More information about the gerrit-log mailing list