Class: USB::Bus

Inherits:
Object
  • Object
show all
Defined in:
lib/usb.rb

Instance Method Summary collapse

Instance Method Details

#configurationsObject



139
# File 'lib/usb.rb', line 139

def configurations() self.devices.map {|d| d.configurations }.flatten end

#devicesObject



129
130
131
132
133
134
135
136
137
# File 'lib/usb.rb', line 129

def devices
  result = []
  device = self.first_device
  while device
    result << device
    device = device.next
  end
  result.sort_by {|d| d.filename }
end

#endpointsObject



142
# File 'lib/usb.rb', line 142

def endpoints() self.settings.map {|d| d.endpoints }.flatten end

#find_device(n) ⇒ Object



144
145
146
147
148
149
150
151
# File 'lib/usb.rb', line 144

def find_device(n)
  device = self.first_device
  while device
    return device if n == device.filename.to_i
    device = device.next
  end
  return nil
end

#inspectObject



121
122
123
124
125
126
127
# File 'lib/usb.rb', line 121

def inspect
  if self.revoked?
    "\#<#{self.class} revoked>"
  else
    "\#<#{self.class} #{self.dirname}>"
  end
end

#interfacesObject



140
# File 'lib/usb.rb', line 140

def interfaces() self.configurations.map {|d| d.interfaces }.flatten end

#settingsObject



141
# File 'lib/usb.rb', line 141

def settings() self.interfaces.map {|d| d.settings }.flatten end