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.
246 247 248 249 250 |
# File 'lib/libusb/bos.rb', line 246 def initialize(ctx, *args) super(*args) register_context(ctx, :libusb_free_platform_descriptor) end |
Instance Method Details
#bReserved ⇒ Object
Reserved field
253 254 255 |
# File 'lib/libusb/bos.rb', line 253 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.
265 266 267 |
# File 'lib/libusb/bos.rb', line 265 def capabilityData self[:CapabilityData].to_ptr.read_bytes(bLength - 20) end |
#inspect ⇒ Object
269 270 271 |
# File 'lib/libusb/bos.rb', line 269 def inspect "\#<#{self.class} #{platformCapabilityUUID.unpack1("H*")} (#{capabilityData.unpack1("H*")})>" end |
#platformCapabilityUUID ⇒ String
Returns 128 bit UUID.
258 259 260 |
# File 'lib/libusb/bos.rb', line 258 def platformCapabilityUUID self[:PlatformCapabilityUUID].to_ptr.read_bytes(16) end |