From a929bc8850573e7790ad7fe35fcce189f85e899f Mon Sep 17 00:00:00 2001 From: Christina Quast Date: Fri, 19 Jun 2015 13:24:29 +0200 Subject: ccid_raw.py: SendTransmit: Pass list instead of array SCardTransmit expects the last function parameter cmd (the bytes to be send) to be of type list, but we pass a binary array to send_receive_cmd. Therefore, the cmd array has to be converted using its function tolist(). --- usb_application/ccid_raw.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usb_application/ccid_raw.py b/usb_application/ccid_raw.py index bd315e5..4447e34 100755 --- a/usb_application/ccid_raw.py +++ b/usb_application/ccid_raw.py @@ -71,7 +71,7 @@ class SmartcardConnection: def send_receive_cmd(self, cmd): print("Cmd to SIM: " + HEX(cmd)) hresult, resp = SCardTransmit(self.hcard, self.dwActiveProtocol, - cmd) + cmd.tolist()) if hresult != SCARD_S_SUCCESS: raise SmartcardException('Failed to transmit: ' + SCardGetErrorMessage(hresult)) -- cgit v1.2.3