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