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.



304
305
306
307
308
309
# File 'lib/libusb/transfer.rb', line 304

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



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

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



324
325
326
# File 'lib/libusb/transfer.rb', line 324

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



314
315
316
317
# File 'lib/libusb/transfer.rb', line 314

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