Change in pysim[master]: commands.py: Introduce a real select_file() method

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
Tue Mar 2 06:36:07 UTC 2021


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


Change subject: commands.py: Introduce a real select_file() method
......................................................................

commands.py: Introduce a real select_file() method

This method, like select_adf(), only selects a single file ID
and unlike select_path() returns the actual status words returned by the
card.

Change-Id: I8bc86654c6d79f2428e196cc8a401e12d93a676b
---
M pySim/commands.py
1 file changed, 4 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/73/23173/1

diff --git a/pySim/commands.py b/pySim/commands.py
index d6159ea..2fb1041 100644
--- a/pySim/commands.py
+++ b/pySim/commands.py
@@ -115,10 +115,13 @@
 		if type(dir_list) is not list:
 			dir_list = [dir_list]
 		for i in dir_list:
-			data, sw = self._tp.send_apdu_checksw(self.cla_byte + "a4" + self.sel_ctrl + "02" + i)
+			data, sw = self.select_file(i)
 			rv.append(data)
 		return rv
 
+	def select_file(self, fid):
+		return self._tp.send_apdu_checksw(self.cla_byte + "a4" + self.sel_ctrl + "02" + fid)
+
 	def select_adf(self, aid):
 		aidlen = ("0" + format(len(aid) // 2, 'x'))[-2:]
 		return self._tp.send_apdu_checksw(self.cla_byte + "a4" + "0404" + aidlen + aid)

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I8bc86654c6d79f2428e196cc8a401e12d93a676b
Gerrit-Change-Number: 23173
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210302/76b06408/attachment.htm>


More information about the gerrit-log mailing list