Change in pysim[master]: cards.py: Add generic function to read EF binary to 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
Wed Apr 1 07:37:22 UTC 2020


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


Change subject: cards.py: Add generic function to read EF binary to card class
......................................................................

cards.py: Add generic function to read EF binary to card class

This is a generic function applicable for reading EFs which doesnt require further processing
such as GID1, GID2 etc while decoding and also to avoid code duplication.

Change-Id: If3d8fdddb26f9776c89fd442d1d95b83e0d1476b
---
M pySim/cards.py
1 file changed, 4 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/95/17695/1

diff --git a/pySim/cards.py b/pySim/cards.py
index 495d3ee..7d3b7b4 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -145,6 +145,10 @@
 		data, sw = self._scc.update_binary(EF['SPN'], rpad(content, 32))
 		return sw
 
+	def read_binary(self, ef, length=None, offset=0):
+		ef_path = ef in EF and EF[ef] or ef
+		return self._scc.read_binary(ef_path, length, offset)
+
 	def read_gid1(self):
 		(res, sw) = self._scc.read_binary(EF['GID1'])
 		if sw == '9000':

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: If3d8fdddb26f9776c89fd442d1d95b83e0d1476b
Gerrit-Change-Number: 17695
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/20200401/6fd6faee/attachment.htm>


More information about the gerrit-log mailing list