Class: LIBUSB::Bos::SsplusSublinkAttribute
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- LIBUSB::Bos::SsplusSublinkAttribute
- Defined in:
- lib/libusb/bos.rb
Overview
A structure representing a SuperSpeedPlus descriptor attribute
Instance Method Summary collapse
-
#direction ⇒ Object
This field indicates if this Sublink Speed Attribute defines the receive or transmit bit rate.
-
#exponent ⇒ Object
This field defines the base 10 exponent times 3, that shall be applied to the mantissa.
- #inspect ⇒ Object
-
#mantissa ⇒ Object
This field defines the mantissa that shall be applied to the exponent when calculating the maximum bit rate.
-
#protocol ⇒ Object
This field identifies the protocol supported by the link.
-
#ssid ⇒ Object
Sublink Speed Attribute ID (SSID).
- #to_s_human_readable ⇒ Object
-
#type ⇒ Object
This field identifies whether the Sublink Speed Attribute defines a symmetric or asymmetric bit rate.
Instance Method Details
#direction ⇒ Object
This field indicates if this Sublink Speed Attribute defines the receive or transmit bit rate.
226 227 228 |
# File 'lib/libusb/bos.rb', line 226 def direction self[:direction] end |
#exponent ⇒ Object
This field defines the base 10 exponent times 3, that shall be applied to the mantissa.
214 215 216 |
# File 'lib/libusb/bos.rb', line 214 def exponent self[:exponent] end |
#inspect ⇒ Object
257 258 259 |
# File 'lib/libusb/bos.rb', line 257 def inspect "\#<#{self.class} #{to_s_human_readable}>" end |
#mantissa ⇒ Object
This field defines the mantissa that shall be applied to the exponent when calculating the maximum bit rate.
237 238 239 |
# File 'lib/libusb/bos.rb', line 237 def mantissa self[:mantissa] end |
#protocol ⇒ Object
This field identifies the protocol supported by the link.
232 233 234 |
# File 'lib/libusb/bos.rb', line 232 def protocol self[:protocol] end |
#ssid ⇒ Object
Sublink Speed Attribute ID (SSID).
This field is an ID that uniquely identifies the speed of this sublink.
208 209 210 |
# File 'lib/libusb/bos.rb', line 208 def ssid self[:ssid] end |
#to_s_human_readable ⇒ Object
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 |
# File 'lib/libusb/bos.rb', line 241 def to_s_human_readable exponents = { SSPLUS_ATTR_EXP_BPS: " ", SSPLUS_ATTR_EXP_KBS: "K", SSPLUS_ATTR_EXP_MBS: "M", SSPLUS_ATTR_EXP_GBS: "G", } format("id=%u speed=%u%sbs %s %s SuperSpeed%s", ssid, mantissa, exponents[exponent], type == :SSPLUS_ATTR_TYPE_ASYM ? "Asym" : "Sym", direction == :SSPLUS_ATTR_DIR_TX ? "TX" : "RX", protocol == :SSPLUS_ATTR_PROT_SSPLUS ? "+": "" ) end |
#type ⇒ Object
This field identifies whether the Sublink Speed Attribute defines a symmetric or asymmetric bit rate.
220 221 222 |
# File 'lib/libusb/bos.rb', line 220 def type self[:type] end |