code: def doTransmit(self, bytes, protocol=None):
          
          if None == protocol:
              protocol = self.getProtocol()
          CardConnection.doTransmit(self, bytes, protocol)
          pcscprotocolheader = translateprotocolheader(protocol)
          if 0 == pcscprotocolheader:
              raise CardConnectionException(
                  'Invalid protocol in transmit: must be ' + \
                  'CardConnection.T0_protocol, ' + \
                  'CardConnection.T1_protocol, or ' + \
                  'CardConnection.RAW_protocol')
          if None == self.hcard:
              raise CardConnectionException('Card not connected')
          hresult, response = SCardTransmit(
              self.hcard, pcscprotocolheader, bytes)
          if hresult != 0:
              raise CardConnectionException(
                  'Failed to transmit with protocol ' + \
                  dictProtocolHeader[pcscprotocolheader] + '. ' + \
                  SCardGetErrorMessage(hresult))
  
          sw1 = (response[-2] + 256) % 256
          sw2 = (response[-1] + 256) % 256
  
          data = [(x + 256) % 256 for x in response[:-2]]
          return list(data), sw1, sw2
docs: Transmit an apdu to the card and return response apdu.
  
          @param bytes:    command apdu to transmit (list of bytes)
  
          @param protocol: the transmission protocol, from
              CardConnection.T0_protocol, CardConnection.T1_protocol, or
              CardConnection.RAW_protocol
  
          @return:     a tuple (response, sw1, sw2) where
                      sw1 is status word 1, e.g. 0x90
                      sw2 is status word 2, e.g. 0x1A
                      response are the response bytes excluding status words