Class: USB::Setting
- Inherits:
-
Data
- Object
- Data
- USB::Setting
- Defined in:
- lib/usb.rb,
ext/usb/usb.c
Instance Method Summary collapse
-
#bAlternateSetting ⇒ Object
USB::Setting#bAlternateSetting.
-
#bDescriptorType ⇒ Object
USB::Setting#bDescriptorType.
-
#bInterfaceClass ⇒ Object
USB::Setting#bInterfaceClass.
-
#bInterfaceNumber ⇒ Object
USB::Setting#bInterfaceNumber.
-
#bInterfaceProtocol ⇒ Object
USB::Setting#bInterfaceProtocol.
-
#bInterfaceSubClass ⇒ Object
USB::Setting#bInterfaceSubClass.
-
#bLength ⇒ Object
USB::Setting#bLength.
-
#bNumEndpoints ⇒ Object
USB::Setting#bNumEndpoints.
- #bus ⇒ Object
- #configuration ⇒ Object
- #description ⇒ Object
- #device ⇒ Object
-
#endpoints ⇒ Object
USB::Setting#endpoints.
-
#iInterface ⇒ Object
USB::Setting#iInterface.
- #inspect ⇒ Object
-
#interface ⇒ Object
USB::Interface#interface.
-
#revoked? ⇒ Boolean
USB::Setting#revoked?.
Instance Method Details
#bAlternateSetting ⇒ Object
USB::Setting#bAlternateSetting
367 |
# File 'ext/usb/usb.c', line 367
static VALUE rusb_setting_bAlternateSetting(VALUE v) { return INT2FIX(get_usb_interface_descriptor(v)->bAlternateSetting); }
|
#bDescriptorType ⇒ Object
USB::Setting#bDescriptorType
361 |
# File 'ext/usb/usb.c', line 361
static VALUE rusb_setting_bDescriptorType(VALUE v) { return INT2FIX(get_usb_interface_descriptor(v)->bDescriptorType); }
|
#bInterfaceClass ⇒ Object
USB::Setting#bInterfaceClass
373 |
# File 'ext/usb/usb.c', line 373
static VALUE rusb_setting_bInterfaceClass(VALUE v) { return INT2FIX(get_usb_interface_descriptor(v)->bInterfaceClass); }
|
#bInterfaceNumber ⇒ Object
USB::Setting#bInterfaceNumber
364 |
# File 'ext/usb/usb.c', line 364
static VALUE rusb_setting_bInterfaceNumber(VALUE v) { return INT2FIX(get_usb_interface_descriptor(v)->bInterfaceNumber); }
|
#bInterfaceProtocol ⇒ Object
USB::Setting#bInterfaceProtocol
379 |
# File 'ext/usb/usb.c', line 379
static VALUE rusb_setting_bInterfaceProtocol(VALUE v) { return INT2FIX(get_usb_interface_descriptor(v)->bInterfaceProtocol); }
|
#bInterfaceSubClass ⇒ Object
USB::Setting#bInterfaceSubClass
376 |
# File 'ext/usb/usb.c', line 376
static VALUE rusb_setting_bInterfaceSubClass(VALUE v) { return INT2FIX(get_usb_interface_descriptor(v)->bInterfaceSubClass); }
|
#bLength ⇒ Object
USB::Setting#bLength
358 |
# File 'ext/usb/usb.c', line 358
static VALUE rusb_setting_bLength(VALUE v) { return INT2FIX(get_usb_interface_descriptor(v)->bLength); }
|
#bNumEndpoints ⇒ Object
USB::Setting#bNumEndpoints
370 |
# File 'ext/usb/usb.c', line 370
static VALUE rusb_setting_bNumEndpoints(VALUE v) { return INT2FIX(get_usb_interface_descriptor(v)->bNumEndpoints); }
|
#bus ⇒ Object
354 |
# File 'lib/usb.rb', line 354 def bus() self.interface.configuration.device.bus end |
#configuration ⇒ Object
356 |
# File 'lib/usb.rb', line 356 def configuration() self.interface.configuration end |
#description ⇒ Object
349 350 351 352 |
# File 'lib/usb.rb', line 349 def description return @description if defined? @description @description = self.device.open {|h| h.get_string_simple(self.iInterface) } end |
#device ⇒ Object
355 |
# File 'lib/usb.rb', line 355 def device() self.interface.configuration.device end |
#endpoints ⇒ Object
USB::Setting#endpoints
385 386 387 388 389 390 391 392 393 394 |
# File 'ext/usb/usb.c', line 385
static VALUE
rusb_setting_endpoints(VALUE v)
{
struct usb_interface_descriptor *p = get_usb_interface_descriptor(v);
int i;
VALUE endpoint = rb_ary_new2(p->bNumEndpoints);
for (i = 0; i < p->bNumEndpoints; i++)
rb_ary_store(endpoint, i, rusb_endpoint_descriptor_make(&p->endpoint[i], v));
return endpoint;
}
|
#iInterface ⇒ Object
USB::Setting#iInterface
382 |
# File 'ext/usb/usb.c', line 382
static VALUE rusb_setting_iInterface(VALUE v) { return INT2FIX(get_usb_interface_descriptor(v)->iInterface); }
|
#inspect ⇒ Object
335 336 337 338 339 340 341 342 343 344 345 346 347 |
# File 'lib/usb.rb', line 335 def inspect if self.revoked? "\#<#{self.class} revoked>" else attrs = [] attrs << self.bAlternateSetting.to_s devclass = USB.dev_string(self.bInterfaceClass, self.bInterfaceSubClass, self.bInterfaceProtocol) attrs << devclass desc = self.description attrs << desc if desc != '?' "\#<#{self.class} #{attrs.join(' ')}>" end end |
#interface ⇒ Object
USB::Interface#interface
355 |
# File 'ext/usb/usb.c', line 355
static VALUE rusb_setting_interface(VALUE v) { return get_rusb_interface_descriptor(v)->parent; }
|
#revoked? ⇒ Boolean
USB::Setting#revoked?
348 349 350 351 352 |
# File 'ext/usb/usb.c', line 348
static VALUE
rusb_setting_revoked_p(VALUE v)
{
return RTEST(!check_usb_interface_descriptor(v));
}
|