Class: USB::Interface
- Inherits:
-
Data
- Object
- Data
- USB::Interface
- Defined in:
- lib/usb.rb,
ext/usb/usb.c
Instance Method Summary collapse
- #bus ⇒ Object
-
#configuration ⇒ Object
USB::Interface#configuration.
- #device ⇒ Object
- #endpoints ⇒ Object
- #inspect ⇒ Object
-
#num_altsetting ⇒ Object
USB::Interface#num_altsetting.
-
#revoked? ⇒ Boolean
USB::Interface#revoked?.
-
#settings ⇒ Object
USB::Interface#settings.
Instance Method Details
#bus ⇒ Object
328 |
# File 'lib/usb.rb', line 328 def bus() self.configuration.device.bus end |
#configuration ⇒ Object
USB::Interface#configuration
328 |
# File 'ext/usb/usb.c', line 328
static VALUE rusb_interface_configuration(VALUE v) { return get_rusb_interface(v)->parent; }
|
#device ⇒ Object
329 |
# File 'lib/usb.rb', line 329 def device() self.configuration.device end |
#endpoints ⇒ Object
331 |
# File 'lib/usb.rb', line 331 def endpoints() self.settings.map {|d| d.endpoints }.flatten end |
#inspect ⇒ Object
320 321 322 323 324 325 326 |
# File 'lib/usb.rb', line 320 def inspect if self.revoked? "\#<#{self.class} revoked>" else "\#<#{self.class}>" end end |
#num_altsetting ⇒ Object
USB::Interface#num_altsetting
331 |
# File 'ext/usb/usb.c', line 331
static VALUE rusb_interface_num_altsetting(VALUE v) { return INT2FIX(get_usb_interface(v)->num_altsetting); }
|
#revoked? ⇒ Boolean
USB::Interface#revoked?
321 322 323 324 325 |
# File 'ext/usb/usb.c', line 321
static VALUE
rusb_interface_revoked_p(VALUE v)
{
return RTEST(!check_usb_interface(v));
}
|
#settings ⇒ Object
USB::Interface#settings
334 335 336 337 338 339 340 341 342 343 |
# File 'ext/usb/usb.c', line 334
static VALUE
rusb_interface_settings(VALUE v)
{
struct usb_interface *p = get_usb_interface(v);
int i;
VALUE altsetting = rb_ary_new2(p->num_altsetting);
for (i = 0; i < p->num_altsetting; i++)
rb_ary_store(altsetting, i, rusb_interface_descriptor_make(&p->altsetting[i], v));
return altsetting;
}
|