Change in pysim[master]: Move parsing of PLMNwAcT 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/.

laforge gerrit-no-reply at lists.osmocom.org
Wed Apr 1 09:40:24 UTC 2020


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

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

Move parsing of PLMNwAcT to generic Card class

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

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



diff --git a/pySim-read.py b/pySim-read.py
index d62cdd3..5229dda 100755
--- a/pySim-read.py
+++ b/pySim-read.py
@@ -163,9 +163,9 @@
 
 	# EF.PLMNwAcT
 	try:
-		(res, sw) = scc.read_binary(EF['PLMNwAcT'])
+		(res, sw) = card.read_plmn_act()
 		if sw == '9000':
-			print("PLMNwAcT:\n%s" % (format_xplmn_w_act(res)))
+			print("PLMNwAcT:\n%s" % (res))
 		else:
 			print("PLMNwAcT: Can't read, response code = %s" % (sw,))
 	except Exception as e:
diff --git a/pySim/cards.py b/pySim/cards.py
index d3b6262..16f6881 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -96,6 +96,13 @@
 		data, sw = self._scc.update_binary(EF['OPLMNwAcT'], content + 'ffffff0000' * (size // 5 - 1))
 		return sw
 
+	def read_plmn_act(self):
+		(res, sw) = self._scc.read_binary(EF['PLMNwAcT'])
+		if sw == '9000':
+			return (format_xplmn_w_act(res), sw)
+		else:
+			return (None, sw)
+
 	def update_plmn_act(self, mcc, mnc, access_tech='FFFF'):
 		"""
 		See note in update_hplmn_act()

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I14d7c2dc51fac6d5cf4a708a77ad23d252ba6094
Gerrit-Change-Number: 17661
Gerrit-PatchSet: 2
Gerrit-Owner: herlesupreeth <herlesupreeth at gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: herlesupreeth <herlesupreeth at gmail.com>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200401/5118a3bf/attachment.htm>


More information about the gerrit-log mailing list