code: def translateprotocolmask(protocol):
      
      pcscprotocol = 0
      if None != protocol:
          if CardConnection.T0_protocol & protocol:
              pcscprotocol |= SCARD_PROTOCOL_T0
          if CardConnection.T1_protocol & protocol:
              pcscprotocol |= SCARD_PROTOCOL_T1
          if CardConnection.RAW_protocol & protocol:
              pcscprotocol |= SCARD_PROTOCOL_RAW
          if CardConnection.T15_protocol & protocol:
              pcscprotocol |= SCARD_PROTOCOL_T15
      return pcscprotocol
docs: Translate CardConnection protocol mask into PCSC protocol mask.