Class: USB::Bus
- Inherits:
-
Data
- Object
- Data
- USB::Bus
- Defined in:
- lib/usb.rb,
ext/usb/usb.c
Instance Method Summary collapse
- #configurations ⇒ Object
- #devices ⇒ Object
-
#dirname ⇒ Object
USB::Bus#dirname.
- #endpoints ⇒ Object
- #find_device(n) ⇒ Object
-
#first_device ⇒ Object
USB::Bus#first_device.
- #inspect ⇒ Object
- #interfaces ⇒ Object
-
#location ⇒ Object
USB::Bus#location.
-
#next ⇒ Object
USB::Bus#next.
-
#prev ⇒ Object
USB::Bus#prev.
-
#revoked? ⇒ Boolean
USB::Bus#revoked?.
- #settings ⇒ Object
Instance Method Details
#configurations ⇒ Object
141 |
# File 'lib/usb.rb', line 141 def configurations() self.devices.map {|d| d.configurations }.flatten end |
#devices ⇒ Object
131 132 133 134 135 136 137 138 139 |
# File 'lib/usb.rb', line 131 def devices result = [] device = self.first_device while device result << device device = device.next end result.sort_by {|d| d.filename } end |
#dirname ⇒ Object
USB::Bus#dirname
159 |
# File 'ext/usb/usb.c', line 159
static VALUE rusb_bus_dirname(VALUE v) { return rb_str_new2(get_usb_bus(v)->dirname); }
|
#endpoints ⇒ Object
144 |
# File 'lib/usb.rb', line 144 def endpoints() self.settings.map {|d| d.endpoints }.flatten end |
#find_device(n) ⇒ Object
146 147 148 149 150 151 152 153 |
# File 'lib/usb.rb', line 146 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 |
#first_device ⇒ Object
USB::Bus#first_device
165 |
# File 'ext/usb/usb.c', line 165
static VALUE rusb_bus_first_device(VALUE v) { return rusb_device_make(get_usb_bus(v)->devices, v); }
|
#inspect ⇒ Object
123 124 125 126 127 128 129 |
# File 'lib/usb.rb', line 123 def inspect if self.revoked? "\#<#{self.class} revoked>" else "\#<#{self.class} #{self.dirname}>" end end |
#interfaces ⇒ Object
142 |
# File 'lib/usb.rb', line 142 def interfaces() self.configurations.map {|d| d.interfaces }.flatten end |
#location ⇒ Object
USB::Bus#location
162 |
# File 'ext/usb/usb.c', line 162
static VALUE rusb_bus_location(VALUE v) { return UINT2NUM(get_usb_bus(v)->location); }
|
#next ⇒ Object
USB::Bus#next
156 |
# File 'ext/usb/usb.c', line 156
static VALUE rusb_bus_next(VALUE v) { return rusb_bus_make(get_usb_bus(v)->next, Qnil); }
|
#prev ⇒ Object
USB::Bus#prev
153 |
# File 'ext/usb/usb.c', line 153
static VALUE rusb_bus_prev(VALUE v) { return rusb_bus_make(get_usb_bus(v)->prev, Qnil); }
|
#revoked? ⇒ Boolean
USB::Bus#revoked?
146 147 148 149 150 |
# File 'ext/usb/usb.c', line 146
static VALUE
rusb_bus_revoked_p(VALUE v)
{
return RTEST(!check_usb_bus(v));
}
|
#settings ⇒ Object
143 |
# File 'lib/usb.rb', line 143 def settings() self.interfaces.map {|d| d.settings }.flatten end |