Class: LIBUSB::Bos::ContainerId
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- LIBUSB::Bos::ContainerId
- 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
-
#bReserved ⇒ Object
Reserved field.
-
#container_id ⇒ String
128 bit UUID.
-
#initialize(ctx, *args) ⇒ ContainerId
constructor
A new instance of ContainerId.
- #inspect ⇒ Object
Methods included from GenericMethods
#bDescriptorType, #bDevCapabilityType, #bLength, #dev_capability_data
Constructor Details
#initialize(ctx, *args) ⇒ ContainerId
Returns a new instance of ContainerId.
337 338 339 340 341 |
# File 'lib/libusb/bos.rb', line 337 def initialize(ctx, *args) super(*args) register_context(ctx, :libusb_free_container_id_descriptor) end |
Instance Method Details
#bReserved ⇒ Object
Reserved field
344 345 346 |
# File 'lib/libusb/bos.rb', line 344 def bReserved self[:bReserved] end |
#container_id ⇒ String
Returns 128 bit UUID.
349 350 351 |
# File 'lib/libusb/bos.rb', line 349 def container_id self[:ContainerID].to_ptr.read_bytes(16) end |
#inspect ⇒ Object
353 354 355 |
# File 'lib/libusb/bos.rb', line 353 def inspect "\#<#{self.class} #{container_id.unpack1("H*")}>" end |