Change in pysim[master]: transport: Make all calls go through base class send_apdu_raw()

laforge gerrit-no-reply at lists.osmocom.org
Sat Apr 10 09:35:35 UTC 2021


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


Change subject: transport: Make all calls go through base class send_apdu_raw()
......................................................................

transport: Make all calls go through base class send_apdu_raw()

This allows us to add APDU tracing at one central location in the code

Change-Id: Id0593a2e6d846cc3151443f1022ae7ee030e6673
---
M pySim/transport/__init__.py
M pySim/transport/calypso.py
M pySim/transport/modem_atcmd.py
M pySim/transport/pcsc.py
M pySim/transport/serial.py
5 files changed, 5 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/96/23696/1

diff --git a/pySim/transport/__init__.py b/pySim/transport/__init__.py
index fb8f31d..923787b 100644
--- a/pySim/transport/__init__.py
+++ b/pySim/transport/__init__.py
@@ -68,7 +68,7 @@
 				data : string (in hex) of returned data (ex. "074F4EFFFF")
 				sw   : string (in hex) of status word (ex. "9000")
 		"""
-		pass
+		return self._send_apdu_raw(pdu)
 
 	def send_apdu(self, pdu):
 		"""Sends an APDU and auto fetch response data
diff --git a/pySim/transport/calypso.py b/pySim/transport/calypso.py
index 467d5ee..3c223e6 100644
--- a/pySim/transport/calypso.py
+++ b/pySim/transport/calypso.py
@@ -115,7 +115,7 @@
 	def wait_for_card(self, timeout = None, newcardonly = False):
 		pass # Nothing to do really ...
 
-	def send_apdu_raw(self, pdu):
+	def _send_apdu_raw(self, pdu):
 
 		# Request FULL reset
 		req_msg = L1CTLMessageSIM(h2b(pdu))
diff --git a/pySim/transport/modem_atcmd.py b/pySim/transport/modem_atcmd.py
index fccd388..f5a0f23 100644
--- a/pySim/transport/modem_atcmd.py
+++ b/pySim/transport/modem_atcmd.py
@@ -97,7 +97,7 @@
 	def wait_for_card(self, timeout=None, newcardonly=False):
 		pass # Nothing to do really ...
 
-	def send_apdu_raw(self, pdu):
+	def _send_apdu_raw(self, pdu):
 		# Prepare the command as described in 8.17
 		cmd = 'AT+CSIM=%d,\"%s\"' % (len(pdu), pdu)
 
diff --git a/pySim/transport/pcsc.py b/pySim/transport/pcsc.py
index f08f71a..2433e79 100644
--- a/pySim/transport/pcsc.py
+++ b/pySim/transport/pcsc.py
@@ -71,7 +71,7 @@
 		self.connect()
 		return 1
 
-	def send_apdu_raw(self, pdu):
+	def _send_apdu_raw(self, pdu):
 
 		apdu = h2i(pdu)
 
diff --git a/pySim/transport/serial.py b/pySim/transport/serial.py
index 6d39303..22788a9 100644
--- a/pySim/transport/serial.py
+++ b/pySim/transport/serial.py
@@ -180,7 +180,7 @@
 	def _rx_byte(self):
 		return self._sl.read()
 
-	def send_apdu_raw(self, pdu):
+	def _send_apdu_raw(self, pdu):
 
 		pdu = h2b(pdu)
 		data_len = ord(pdu[4])	# P3

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Id0593a2e6d846cc3151443f1022ae7ee030e6673
Gerrit-Change-Number: 23696
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/20210410/eb0117ca/attachment.htm>


More information about the gerrit-log mailing list