Class: USB::Configuration
- Inherits:
-
Object
- Object
- USB::Configuration
- Defined in:
- lib/usb.rb
Instance Method Summary collapse
Instance Method Details
#bus ⇒ Object
311 |
# File 'lib/usb.rb', line 311 def bus() self.device.bus end |
#description ⇒ Object
306 307 308 309 |
# File 'lib/usb.rb', line 306 def description return @description if defined? @description @description = self.device.open {|h| h.get_string_simple(self.iConfiguration) } end |
#endpoints ⇒ Object
314 |
# File 'lib/usb.rb', line 314 def endpoints() self.settings.map {|d| d.endpoints }.flatten end |
#inspect ⇒ Object
291 292 293 294 295 296 297 298 299 300 301 302 303 304 |
# File 'lib/usb.rb', line 291 def inspect if self.revoked? "\#<#{self.class} revoked>" else attrs = [] attrs << self.bConfigurationValue.to_s bits = self.bmAttributes attrs << "SelfPowered" if (bits & 0b1000000) != 0 attrs << "RemoteWakeup" if (bits & 0b100000) != 0 desc = self.description attrs << desc if desc != '?' "\#<#{self.class} #{attrs.join(' ')}>" end end |
#settings ⇒ Object
313 |
# File 'lib/usb.rb', line 313 def settings() self.interfaces.map {|d| d.settings }.flatten end |