Class: LIBUSB::Bos::ContainerId

Inherits:
FFI::Struct
  • Object
show all
Includes:
GenericMethods
Defined in:
lib/libusb/bos.rb

Overview

A structure representing the Container ID descriptor. This descriptor is documented in section 9.6.2.3 of the USB 3.0 specification. All multiple-byte fields, except UUIDs, are represented in host-endian format.

Instance Method Summary collapse

Methods included from GenericMethods

#bDescriptorType, #bDevCapabilityType, #bLength, #dev_capability_data

Constructor Details

#initialize(ctx, *args) ⇒ ContainerId

Returns a new instance of ContainerId.



205
206
207
208
209
# File 'lib/libusb/bos.rb', line 205

def initialize(ctx, *args)
  super(*args)

  register_context(ctx, :libusb_free_container_id_descriptor)
end

Instance Method Details

#bReservedObject

Reserved field



212
213
214
# File 'lib/libusb/bos.rb', line 212

def bReserved
  self[:bReserved]
end

#container_idString

Returns 128 bit UUID.

Returns:

  • (String)

    128 bit UUID



217
218
219
# File 'lib/libusb/bos.rb', line 217

def container_id
  self[:ContainerID].to_ptr.read_bytes(16)
end

#inspectObject



221
222
223
# File 'lib/libusb/bos.rb', line 221

def inspect
  "\#<#{self.class} #{container_id.unpack1("H*")}>"
end