(self, endpoint, buffer_or_len, callback=None,
            user_data=None, timeout=0, iso_transfer_length_list=None)
Setup transfer for isochronous use.

        endpoint
            Endpoint to submit transfer to. Defines transfer direction (see
            libusb1.LIBUSB_ENDPOINT_OUT and libusb1.LIBUSB_ENDPOINT_IN)).
        buffer_or_len
            Either a string (when sending data), or expected data length (when
            receiving data)
        callback
            Callback function to be invoked on transfer completion.
            Called with transfer as parameter, return value ignored.
        user_data
            User data to pass to callback function.
        timeout
            Transfer timeout in milliseconds. 0 to disable.
        iso_transfer_length_list
            List of individual transfer sizes. If not provided, buffer_or_len
            will be divided evenly among available transfers if possible, and
            raise ValueError otherwise.
Setup transfer for isochronous use.
Setup transfer for isochronous use .
def setIsochronous(self, endpoint, buffer_or_len, callback=None,
            user_data=None, timeout=0, iso_transfer_length_list=None):
        """
        Setup transfer for isochronous use.

        endpoint
            Endpoint to submit transfer to. Defines transfer direction (see
            libusb1.LIBUSB_ENDPOINT_OUT and libusb1.LIBUSB_ENDPOINT_IN)).
        buffer_or_len
            Either a string (when sending data), or expected data length (when
            receiving data)
        callback
            Callback function to be invoked on transfer completion.
            Called with transfer as parameter, return value ignored.
        user_data
            User data to pass to callback function.
        timeout
            Transfer timeout in milliseconds. 0 to disable.
        iso_transfer_length_list
            List of individual transfer sizes. If not provided, buffer_or_len
            will be divided evenly among available transfers if possible, and
            raise ValueError otherwise.
        """
        if self.__submitted:
            raise ValueError('Cannot alter a submitted transfer')
        num_iso_packets = self.__num_iso_packets
        if num_iso_packets == 0:
            raise TypeError('This transfer canot be used for isochronous I/O. '
                'You must get another one with a non-zero iso_packets '
                'parameter.')
        if self.__doomed:
            raise DoomedTransferError('Cannot reuse a doomed transfer')
        string_buffer = create_binary_buffer(buffer_or_len)
        buffer_length = sizeof(string_buffer)
        if iso_transfer_length_list is None:
            iso_length, remainder = divmod(buffer_length, num_iso_packets)
            if remainder:
                raise ValueError('Buffer size %i cannot be evenly '
                    'distributed among %i transfers' % (buffer_length,
                    num_iso_packets))
            iso_transfer_length_list = [iso_length] * num_iso_packets
        configured_iso_packets = len(iso_transfer_length_list)
        if configured_iso_packets > num_iso_packets:
            raise ValueError('Too many ISO transfer lengths (%i), there are '
                'only %i ISO transfers available' % (configured_iso_packets,
                    num_iso_packets))
        if sum(iso_transfer_length_list) > buffer_length:
            raise ValueError('ISO transfers too long (%i), there are only '
                '%i bytes available' % (sum(iso_transfer_length_list),
                    buffer_length))
        transfer_p = self.__transfer
        self.__initialized = False
        self.__transfer_buffer = string_buffer
        self.__user_data = user_data
        libusb1.libusb_fill_iso_transfer(transfer_p, self.__handle,
            endpoint, string_buffer, buffer_length, configured_iso_packets,
            self.__ctypesCallbackWrapper, None, timeout)
        for length, iso_packet_desc in zip(iso_transfer_length_list,
                libusb1.get_iso_packet_list(transfer_p)):
            if length <= 0:
                raise ValueError('Negative/null length transfers are not '
                    'possible.')
            iso_packet_desc.length = length
        self.__callback = callback
        self.__initialized = True
def setIsochronous ( self , endpoint , buffer_or_len , callback = None , user_data = None , timeout = 0 , iso_transfer_length_list = None ) : if self . __submitted : raise ValueError ( 'Cannot alter a submitted transfer' ) num_iso_packets = self . __num_iso_packets if num_iso_packets == 0 : raise TypeError ( 'This transfer canot be used for isochronous I/O. ' 'You must get another one with a non-zero iso_packets ' 'parameter.' ) if self . __doomed : raise DoomedTransferError ( 'Cannot reuse a doomed transfer' ) string_buffer = create_binary_buffer ( buffer_or_len ) buffer_length = sizeof ( string_buffer ) if iso_transfer_length_list is None : iso_length , remainder = divmod ( buffer_length , num_iso_packets ) if remainder : raise ValueError ( 'Buffer size %i cannot be evenly ' 'distributed among %i transfers' % ( buffer_length , num_iso_packets ) ) iso_transfer_length_list = [ iso_length ] * num_iso_packets configured_iso_packets = len ( iso_transfer_length_list ) if configured_iso_packets > num_iso_packets : raise ValueError ( 'Too many ISO transfer lengths (%i), there are ' 'only %i ISO transfers available' % ( configured_iso_packets , num_iso_packets ) ) if sum ( iso_transfer_length_list ) > buffer_length : raise ValueError ( 'ISO transfers too long (%i), there are only ' '%i bytes available' % ( sum ( iso_transfer_length_list ) , buffer_length ) ) transfer_p = self . __transfer self . __initialized = False self . __transfer_buffer = string_buffer self . __user_data = user_data libusb1 . libusb_fill_iso_transfer ( transfer_p , self . __handle , endpoint , string_buffer , buffer_length , configured_iso_packets , self . __ctypesCallbackWrapper , None , timeout ) for length , iso_packet_desc in zip ( iso_transfer_length_list , libusb1 . get_iso_packet_list ( transfer_p ) ) : if length <= 0 : raise ValueError ( 'Negative/null length transfers are not ' 'possible.' ) iso_packet_desc . length = length self . __callback = callback self . __initialized = True