Change in pysim[master]: Move parsing of HPLMNAcT 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:25 UTC 2020


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

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

Move parsing of HPLMNAcT to generic Card class

Change-Id: I46c863c118dcbef89455c34289ed25e5a342f35b
---
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 4446987..f54045b 100755
--- a/pySim-read.py
+++ b/pySim-read.py
@@ -183,9 +183,9 @@
 
 	# EF.HPLMNAcT
 	try:
-		(res, sw) = scc.read_binary(EF['HPLMNAcT'])
+		(res, sw) = card.read_hplmn_act()
 		if sw == '9000':
-			print("HPLMNAcT:\n%s" % (format_xplmn_w_act(res)))
+			print("HPLMNAcT:\n%s" % (res))
 		else:
 			print("HPLMNAcT: Can't read, response code = %s" % (sw,))
 	except Exception as e:
diff --git a/pySim/cards.py b/pySim/cards.py
index 55d1979..8081f87 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -66,6 +66,13 @@
 		data, sw = self._scc.update_binary(EF['ACC'], lpad(acc, 4))
 		return sw
 
+	def read_hplmn_act(self):
+		(res, sw) = self._scc.read_binary(EF['HPLMNAcT'])
+		if sw == '9000':
+			return (format_xplmn_w_act(res), sw)
+		else:
+			return (None, sw)
+
 	def update_hplmn_act(self, mcc, mnc, access_tech='FFFF'):
 		"""
 		Update Home PLMN with access technology bit-field

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I46c863c118dcbef89455c34289ed25e5a342f35b
Gerrit-Change-Number: 17663
Gerrit-PatchSet: 2
Gerrit-Owner: herlesupreeth <herlesupreeth at gmail.com>
Gerrit-Reviewer: Jenkins Builder
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/51eed5d3/attachment.htm>


More information about the gerrit-log mailing list