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


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


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

Move parsing of AD to generic Card class

Change-Id: Ie7f62913caed95f482445962954857bb69b58078
---
M pySim-read.py
M pySim/cards.py
2 files changed, 8 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/66/17666/1

diff --git a/pySim-read.py b/pySim-read.py
index b84be29..468dadd 100755
--- a/pySim-read.py
+++ b/pySim-read.py
@@ -213,7 +213,7 @@
 		print("MSISDN: Can't read file -- " + str(e))
 
 	# EF.AD
-	(res, sw) = scc.read_binary(['3f00', '7f20', '6fad'])
+	(res, sw) = card.read_ad()
 	if sw == '9000':
 		print("AD: %s" % (res,))
 	else:
diff --git a/pySim/cards.py b/pySim/cards.py
index 06753c3..4141a79 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -161,6 +161,13 @@
 		data, sw = self._scc.update_record(EF['SMSP'], 1, rpad(smsp, 84))
 		return sw
 
+	def read_ad(self):
+		(res, sw) = self._scc.read_binary(EF['AD'])
+		if sw == '9000':
+			return (res, sw)
+		else:
+			return (None, sw)
+
 	def update_ad(self, mnc):
 		#See also: 3GPP TS 31.102, chapter 4.2.18
 		mnclen = len(str(mnc))

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ie7f62913caed95f482445962954857bb69b58078
Gerrit-Change-Number: 17666
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/2a5d4b9b/attachment.htm>


More information about the gerrit-log mailing list