Class: USB::Bus

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

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ Bus

Returns a new instance of Bus.



141
142
143
# File 'lib/libusb/compat.rb', line 141

def initialize(context)
  @ct = context
end

Instance Method Details

#configurationsObject



148
# File 'lib/libusb/compat.rb', line 148

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

#devicesObject



144
145
146
# File 'lib/libusb/compat.rb', line 144

def devices
  @ct.devices.map{|d| Device.new(d) }
end

#endpointsObject



151
# File 'lib/libusb/compat.rb', line 151

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

#find_device(n) ⇒ Object

Raises:

  • (NotImplementedError)


153
154
155
# File 'lib/libusb/compat.rb', line 153

def find_device(n)
  raise NotImplementedError
end

#interfacesObject



149
# File 'lib/libusb/compat.rb', line 149

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

#settingsObject



150
# File 'lib/libusb/compat.rb', line 150

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