Class: LIBUSB::Bos::SsUsbDeviceCapability
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- LIBUSB::Bos::SsUsbDeviceCapability
- 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
-
#bFunctionalitySupport ⇒ Integer
The lowest speed at which all the functionality supported by the device is available to the user.
-
#bm_ltm_support? ⇒ Boolean
Supports Latency Tolerance Messages (LTM).
-
#bmAttributes ⇒ Integer
Bitmap encoding of supported device level features.
-
#bU1DevExitLat ⇒ Integer
U1 Device Exit Latency.
-
#bU2DevExitLat ⇒ Integer
U2 Device Exit Latency.
-
#initialize(ctx, *args) ⇒ SsUsbDeviceCapability
constructor
A new instance of SsUsbDeviceCapability.
- #inspect ⇒ Object
-
#supported_speeds ⇒ Array<Symbol>
Speeds supported by this device when operating in SuperSpeed mode Call::SupportedSpeeds.
-
#wSpeedSupported ⇒ Integer
Bitmap encoding of the speed supported by this device when operating in SuperSpeed mode.
Methods included from GenericMethods
#bDescriptorType, #bDevCapabilityType, #bLength, #dev_capability_data
Constructor Details
#initialize(ctx, *args) ⇒ SsUsbDeviceCapability
Returns a new instance of SsUsbDeviceCapability.
121 122 123 124 125 |
# File 'lib/libusb/bos.rb', line 121 def initialize(ctx, *args) super(*args) register_context(ctx, :libusb_free_ss_usb_device_capability_descriptor) end |
Instance Method Details
#bFunctionalitySupport ⇒ Integer
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
177 178 179 |
# File 'lib/libusb/bos.rb', line 177 def bFunctionalitySupport self[:bFunctionalitySupport] end |
#bm_ltm_support? ⇒ Boolean
Returns Supports Latency Tolerance Messages (LTM).
138 139 140 |
# File 'lib/libusb/bos.rb', line 138 def bm_ltm_support? (bmAttributes & BM_LTM_SUPPORT) != 0 end |
#bmAttributes ⇒ Integer
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.
133 134 135 |
# File 'lib/libusb/bos.rb', line 133 def bmAttributes self[:bmAttributes] end |
#bU1DevExitLat ⇒ Integer
Returns U1 Device Exit Latency.
182 183 184 |
# File 'lib/libusb/bos.rb', line 182 def bU1DevExitLat self[:bU1DevExitLat] end |
#bU2DevExitLat ⇒ Integer
Returns U2 Device Exit Latency.
187 188 189 |
# File 'lib/libusb/bos.rb', line 187 def bU2DevExitLat self[:bU2DevExitLat] end |
#inspect ⇒ Object
142 143 144 145 146 147 |
# File 'lib/libusb/bos.rb', line 142 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_speeds ⇒ Array<Symbol>
Returns speeds supported by this device when operating in SuperSpeed mode Call::SupportedSpeeds.
160 161 162 163 164 165 |
# File 'lib/libusb/bos.rb', line 160 def supported_speeds speeds = Call::SupportedSpeeds.to_h.map do |k,v| (wSpeedSupported & v) != 0 ? k : nil end speeds.compact end |
#wSpeedSupported ⇒ Integer
Bitmap encoding of the speed supported by this device when operating in SuperSpeed mode.
154 155 156 |
# File 'lib/libusb/bos.rb', line 154 def wSpeedSupported self[:wSpeedSupported] end |