(self, buffer_or_len)
Replace buffer with a new one.
        Allows resizing read buffer and replacing data sent.
        Note: resizing is not allowed for isochronous buffer (use
        setIsochronous).
        Note: disallowed on control transfers (use setControl).
Replace buffer with a new one.
        Allows resizing read buffer and replacing data sent.
        Note: resizing is not allowed for isochronous buffer (use
        setIsochronous).
        Note: disallowed on control transfers (use setControl).
Replace buffer with a new one . Allows resizing read buffer and replacing data sent . Note : resizing is not allowed for isochronous buffer ( use setIsochronous ) . Note : disallowed on control transfers ( use setControl ) .
def setBuffer(self, buffer_or_len):
        """
        Replace buffer with a new one.
        Allows resizing read buffer and replacing data sent.
        Note: resizing is not allowed for isochronous buffer (use
        setIsochronous).
        Note: disallowed on control transfers (use setControl).
        """
        if self.__submitted:
            raise ValueError('Cannot alter a submitted transfer')
        transfer = self.__transfer.contents
        if transfer.type == libusb1.LIBUSB_TRANSFER_TYPE_CONTROL:
            raise ValueError('To alter control transfer buffer, use '
                'setControl')
        buff = create_binary_buffer(buffer_or_len)
        if transfer.type == libusb1.LIBUSB_TRANSFER_TYPE_ISOCHRONOUS and \
                sizeof(buff) != transfer.length:
            raise ValueError('To alter isochronous transfer buffer length, '
                'use setIsochronous')
        self.__transfer_buffer = buff
        transfer.buffer = cast(buff, c_void_p)
        transfer.length = sizeof(buff)
def setBuffer ( self , buffer_or_len ) : if self . __submitted : raise ValueError ( 'Cannot alter a submitted transfer' ) transfer = self . __transfer . contents if transfer . type == libusb1 . LIBUSB_TRANSFER_TYPE_CONTROL : raise ValueError ( 'To alter control transfer buffer, use ' 'setControl' ) buff = create_binary_buffer ( buffer_or_len ) if transfer . type == libusb1 . LIBUSB_TRANSFER_TYPE_ISOCHRONOUS and sizeof ( buff ) != transfer . length : raise ValueError ( 'To alter isochronous transfer buffer length, ' 'use setIsochronous' ) self . __transfer_buffer = buff transfer . buffer = cast ( buff , c_void_p ) transfer . length = sizeof ( buff )