Class: LIBUSB::Bos::PlatformDescriptor
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- LIBUSB::Bos::PlatformDescriptor
- Includes:
- GenericMethods
- Defined in:
- lib/libusb/bos.rb
Overview
A structure representing a Platform descriptor. This descriptor is documented in section 9.6.2.4 of the USB 3.2 specification.
Instance Method Summary collapse
-
#bReserved ⇒ Object
Reserved field.
-
#capabilityData ⇒ String
This is a variable-length field containing data associated with the platform specific capability.
-
#initialize(ctx, *args) ⇒ PlatformDescriptor
constructor
A new instance of PlatformDescriptor.
- #inspect ⇒ Object
-
#platformCapabilityUUID ⇒ String
128 bit UUID.
Methods included from GenericMethods
#bDescriptorType, #bDevCapabilityType, #bLength, #dev_capability_data
Constructor Details
#initialize(ctx, *args) ⇒ PlatformDescriptor
Returns a new instance of PlatformDescriptor.
378 379 380 381 382 |
# File 'lib/libusb/bos.rb', line 378 def initialize(ctx, *args) super(*args) register_context(ctx, :libusb_free_platform_descriptor) end |
Instance Method Details
#bReserved ⇒ Object
Reserved field
385 386 387 |
# File 'lib/libusb/bos.rb', line 385 def bReserved self[:bReserved] end |
#capabilityData ⇒ String
This is a variable-length field containing data associated with the platform specific capability. This field may be zero bytes in length.
397 398 399 |
# File 'lib/libusb/bos.rb', line 397 def capabilityData self[:CapabilityData].to_ptr.read_bytes(bLength - 20) end |
#inspect ⇒ Object
401 402 403 |
# File 'lib/libusb/bos.rb', line 401 def inspect "\#<#{self.class} #{platformCapabilityUUID.unpack1("H*")} (#{capabilityData.unpack1("H*")})>" end |
#platformCapabilityUUID ⇒ String
Returns 128 bit UUID.
390 391 392 |
# File 'lib/libusb/bos.rb', line 390 def platformCapabilityUUID self[:PlatformCapabilityUUID].to_ptr.read_bytes(16) end |