Class: LIBUSB::Bos::SsUsbDeviceCapability

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

Overview

A structure representing the SuperSpeed USB Device Capability descriptor This descriptor is documented in section 9.6.2.2 of the USB 3.0 specification. All multiple-byte fields are represented in host-endian format.

Instance Method Summary collapse

Methods included from GenericMethods

#bDescriptorType, #bDevCapabilityType, #bLength, #dev_capability_data

Instance Method Details

#bFunctionalitySupportInteger

The lowest speed at which all the functionality supported by the device is available to the user. For example if the device supports all its functionality when connected at full speed and above then it sets this value to 1.

0 - low speed 1 - full speed 2 - high speed 3 - super speed

Returns:

  • (Integer)

168
169
170
# File 'lib/libusb/bos.rb', line 168

def bFunctionalitySupport
  self[:bFunctionalitySupport]
end

#bm_ltm_support?Boolean

Returns Supports Latency Tolerance Messages (LTM).

Returns:

  • (Boolean)

    Supports Latency Tolerance Messages (LTM)


129
130
131
# File 'lib/libusb/bos.rb', line 129

def bm_ltm_support?
  (bmAttributes & BM_LTM_SUPPORT) != 0
end

#bmAttributesInteger

Bitmap encoding of supported device level features. A value of one in a bit location indicates a feature is supported; a value of zero indicates it is not supported.

Returns:

  • (Integer)

See Also:


124
125
126
# File 'lib/libusb/bos.rb', line 124

def bmAttributes
  self[:bmAttributes]
end

#bU1DevExitLatInteger

Returns U1 Device Exit Latency.

Returns:

  • (Integer)

    U1 Device Exit Latency.


173
174
175
# File 'lib/libusb/bos.rb', line 173

def bU1DevExitLat
  self[:bU1DevExitLat]
end

#bU2DevExitLatInteger

Returns U2 Device Exit Latency.

Returns:

  • (Integer)

    U2 Device Exit Latency.


178
179
180
# File 'lib/libusb/bos.rb', line 178

def bU2DevExitLat
  self[:bU2DevExitLat]
end

#inspectObject


133
134
135
136
137
138
# File 'lib/libusb/bos.rb', line 133

def inspect
  attrs = Call::SsUsbDeviceCapabilityAttributes.to_h.map do |k,v|
    (bmAttributes & v) != 0 ? k.to_s : nil
  end
  "\#<#{self.class} #{attrs.compact.join(",")} #{supported_speeds.join(",")}>"
end

#supported_speedsArray<Symbol>

Returns speeds supported by this device when operating in SuperSpeed mode Call::SupportedSpeeds.

Returns:

  • (Array<Symbol>)

    speeds supported by this device when operating in SuperSpeed mode Call::SupportedSpeeds


151
152
153
154
155
156
# File 'lib/libusb/bos.rb', line 151

def supported_speeds
  speeds = Call::SupportedSpeeds.to_h.map do |k,v|
    (wSpeedSupported & v) != 0 ? k : nil
  end
  speeds.compact
end

#wSpeedSupportedInteger

Bitmap encoding of the speed supported by this device when operating in SuperSpeed mode.

Returns:

  • (Integer)

See Also:


145
146
147
# File 'lib/libusb/bos.rb', line 145

def wSpeedSupported
  self[:wSpeedSupported]
end