Module: LIBUSB::Bos::GenericMethods

Included in:
ContainerId, DeviceCapability, SsUsbDeviceCapability, Usb20Extension
Defined in:
lib/libusb/bos.rb

Instance Method Summary collapse

Instance Method Details

#bDescriptorTypeInteger

in this context.

Returns:

  • (Integer)

    Descriptor type. Will have value LIBUSB::DT_DEVICE_CAPABILITY


32
33
34
# File 'lib/libusb/bos.rb', line 32

def bDescriptorType
  self[:bDescriptorType]
end

#bDevCapabilityTypeInteger

Returns Device Capability type.

Returns:

  • (Integer)

    Device Capability type


37
38
39
# File 'lib/libusb/bos.rb', line 37

def bDevCapabilityType
  self[:bDevCapabilityType]
end

#bLengthInteger

Returns Size of this descriptor (in bytes).

Returns:

  • (Integer)

    Size of this descriptor (in bytes)


26
27
28
# File 'lib/libusb/bos.rb', line 26

def bLength
  self[:bLength]
end

#dev_capability_dataString

Returns Device Capability data (bLength - 3 bytes).

Returns:

  • (String)

    Device Capability data (bLength - 3 bytes)


46
47
48
# File 'lib/libusb/bos.rb', line 46

def dev_capability_data
  pointer.read_bytes(bLength - 3)
end

#inspectObject


41
42
43
# File 'lib/libusb/bos.rb', line 41

def inspect
  "\#<#{self.class} cap: #{bDevCapabilityType} data: #{dev_capability_data.unpack("H*")[0]}>"
end