Class: LIBUSB::BulkStreamTransfer

Inherits:
Transfer
  • Object
show all
Defined in:
lib/libusb/transfer.rb

Overview

Transfer class for USB bulk transfers using USB-3.0 streams.

Available since libusb-1.0.19.

Constant Summary

Constants inherited from Transfer

Transfer::TransferStatusToError

Instance Attribute Summary

Attributes inherited from Transfer

#allow_device_memory, #dev_handle

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Transfer

#actual_buffer, #actual_length, #alloc_buffer, #buffer, #buffer=, #callback=, #cancel!, #endpoint=, #free_buffer, #memory_type, #status, #submit!, #submit_and_wait, #submit_and_wait!, #timeout, #timeout=

Constructor Details

#initialize(args = {}) ⇒ BulkStreamTransfer

Returns a new instance of BulkStreamTransfer.



300
301
302
303
304
305
# File 'lib/libusb/transfer.rb', line 300

def initialize(args={})
  @transfer = Call::Transfer.new Call.libusb_alloc_transfer(0)
  @transfer[:type] = TRANSFER_TYPE_BULK_STREAM
  @transfer[:timeout] = 1000
  super
end

Class Method Details

.newObject



296
297
298
# File 'lib/libusb/transfer.rb', line 296

def self.new(*)
  super
end

Instance Method Details

#stream_idFixnum

Get a transfers bulk stream id.

Available since libusb-1.0.19.

Returns:

  • (Fixnum)

    the stream id for the transfer



320
321
322
# File 'lib/libusb/transfer.rb', line 320

def stream_id
  Call.libusb_transfer_get_stream_id(@transfer)
end

#stream_id=(v) ⇒ Object

Set a transfers bulk stream id.

Parameters:

  • stream_id (Fixnum)

    the stream id to set



310
311
312
313
# File 'lib/libusb/transfer.rb', line 310

def stream_id=(v)
  Call.libusb_transfer_set_stream_id(@transfer, v)
  v
end