def set_descriptor(dev, desc, desc_type, desc_index, wIndex=None):
 wValue = (desc_index | (desc_type << 8))
 bmRequestType = util.build_request_type(util.CTRL_OUT, util.CTRL_TYPE_STANDARD, util.CTRL_RECIPIENT_DEVICE)
 dev.ctrl_transfer(bmRequestType=bmRequestType, bRequest=7, wValue=wValue, wIndex=wIndex, data_or_wLength=desc)

def set_descriptor ( dev , desc , desc_type , desc_index , wIndex = None ) : wValue = ( desc_index | ( desc_type << 8 ) ) bmRequestType = util . build_request_type ( util . CTRL_OUT , util . CTRL_TYPE_STANDARD , util . CTRL_RECIPIENT_DEVICE ) dev . ctrl_transfer ( bmRequestType = bmRequestType , bRequest = 7 , wValue = wValue , wIndex = wIndex , data_or_wLength = desc )
update an existing descriptor or add a new one .