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
Wed Mar 3 07:38:46 UTC 2021


laforge has submitted this change. ( 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(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  dexter: Looks good to me, but someone else must approve



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: 8
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210303/3f315e3d/attachment.htm>


More information about the gerrit-log mailing list