Change in pysim[master]: transport/__init.py__ add generic ATR hex read function

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/.

guilly@gmail.com gerrit-no-reply at lists.osmocom.org
Fri Apr 24 13:29:50 UTC 2020


guilly at gmail.com has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/17934 )


Change subject: transport/__init.py__ add generic ATR hex read function
......................................................................

transport/__init.py__ add generic ATR hex read function

useful for debugging the ATR response in hex, similar
format to the oen used in most of the autodetect functions

Change-Id: Id0e53ef50e32a8c3d2190581540b011eb89f8cc0
---
M pySim/transport/__init__.py
1 file changed, 8 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/34/17934/1

diff --git a/pySim/transport/__init__.py b/pySim/transport/__init__.py
index 69e2fe9..676167c 100644
--- a/pySim/transport/__init__.py
+++ b/pySim/transport/__init__.py
@@ -90,6 +90,7 @@
 			    data : string (in hex) of returned data (ex. "074F4EFFFF")
 			    sw   : string (in hex) of status word (ex. "9000")
 		"""
+		print(pdu)
 		rv = self.send_apdu(pdu)
 
 		# Create a masked version of the returned status word
@@ -103,3 +104,10 @@
 		if sw.lower() != sw_masked:
 			raise RuntimeError("SW match failed! Expected %s and got %s." % (sw.lower(), rv[1]))
 		return rv
+
+	def get_atr_in_hex(self):
+		atr = ''
+		for byte in self.get_atr():
+			atr += '%02x ' % byte
+		return atr
+		
\ No newline at end of file

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Id0e53ef50e32a8c3d2190581540b011eb89f8cc0
Gerrit-Change-Number: 17934
Gerrit-PatchSet: 1
Gerrit-Owner: guilly at gmail.com <guilly at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200424/58400536/attachment.htm>


More information about the gerrit-log mailing list