Class: USB::Configuration
- Inherits:
-
Data
- Object
- Data
- USB::Configuration
- Defined in:
- lib/usb.rb,
ext/usb/usb.c
Instance Method Summary collapse
-
#bConfigurationValue ⇒ Object
USB::Configuration#bConfigurationValue.
-
#bDescriptorType ⇒ Object
USB::Configuration#bDescriptorType.
-
#bLength ⇒ Object
USB::Configuration#bLength.
-
#bmAttributes ⇒ Object
USB::Configuration#bmAttributes.
-
#bMaxPower ⇒ Object
USB::Configuration#bMaxPower.
-
#bNumInterfaces ⇒ Object
USB::Configuration#bNumInterfaces.
- #bus ⇒ Object
- #description ⇒ Object
-
#device ⇒ Object
USB::Configuration#device.
- #endpoints ⇒ Object
-
#iConfiguration ⇒ Object
USB::Configuration#iConfiguration.
- #inspect ⇒ Object
-
#interfaces ⇒ Object
USB::Configuration#interfaces.
-
#revoked? ⇒ Boolean
USB::Configuration#revoked?.
- #settings ⇒ Object
-
#wTotalLength ⇒ Object
USB::Configuration#wTotalLength.
Instance Method Details
#bConfigurationValue ⇒ Object
USB::Configuration#bConfigurationValue
295 |
# File 'ext/usb/usb.c', line 295
static VALUE rusb_config_bConfigurationValue(VALUE v) { return INT2FIX(get_usb_config_descriptor(v)->bConfigurationValue); }
|
#bDescriptorType ⇒ Object
USB::Configuration#bDescriptorType
286 |
# File 'ext/usb/usb.c', line 286
static VALUE rusb_config_bDescriptorType(VALUE v) { return INT2FIX(get_usb_config_descriptor(v)->bDescriptorType); }
|
#bLength ⇒ Object
USB::Configuration#bLength
283 |
# File 'ext/usb/usb.c', line 283
static VALUE rusb_config_bLength(VALUE v) { return INT2FIX(get_usb_config_descriptor(v)->bLength); }
|
#bmAttributes ⇒ Object
USB::Configuration#bmAttributes
301 |
# File 'ext/usb/usb.c', line 301
static VALUE rusb_config_bmAttributes(VALUE v) { return INT2FIX(get_usb_config_descriptor(v)->bmAttributes); }
|
#bMaxPower ⇒ Object
USB::Configuration#bMaxPower
304 |
# File 'ext/usb/usb.c', line 304
static VALUE rusb_config_bMaxPower(VALUE v) { return INT2FIX(get_usb_config_descriptor(v)->MaxPower); }
|
#bNumInterfaces ⇒ Object
USB::Configuration#bNumInterfaces
292 |
# File 'ext/usb/usb.c', line 292
static VALUE rusb_config_bNumInterfaces(VALUE v) { return INT2FIX(get_usb_config_descriptor(v)->bNumInterfaces); }
|
#bus ⇒ Object
313 |
# File 'lib/usb.rb', line 313 def bus() self.device.bus end |
#description ⇒ Object
308 309 310 311 |
# File 'lib/usb.rb', line 308 def description return @description if defined? @description @description = self.device.open {|h| h.get_string_simple(self.iConfiguration) } end |
#device ⇒ Object
USB::Configuration#device
280 |
# File 'ext/usb/usb.c', line 280
static VALUE rusb_config_device(VALUE v) { return get_rusb_config_descriptor(v)->parent; }
|
#endpoints ⇒ Object
316 |
# File 'lib/usb.rb', line 316 def endpoints() self.settings.map {|d| d.endpoints }.flatten end |
#iConfiguration ⇒ Object
USB::Configuration#iConfiguration
298 |
# File 'ext/usb/usb.c', line 298
static VALUE rusb_config_iConfiguration(VALUE v) { return INT2FIX(get_usb_config_descriptor(v)->iConfiguration); }
|
#inspect ⇒ Object
293 294 295 296 297 298 299 300 301 302 303 304 305 306 |
# File 'lib/usb.rb', line 293 def inspect if self.revoked? "\#<#{self.class} revoked>" else attrs = [] attrs << self.bConfigurationValue.to_s bits = self.bmAttributes attrs << "SelfPowered" if (bits & 0b1000000) != 0 attrs << "RemoteWakeup" if (bits & 0b100000) != 0 desc = self.description attrs << desc if desc != '?' "\#<#{self.class} #{attrs.join(' ')}>" end end |
#interfaces ⇒ Object
USB::Configuration#interfaces
307 308 309 310 311 312 313 314 315 316 |
# File 'ext/usb/usb.c', line 307
static VALUE
rusb_config_interfaces(VALUE v)
{
struct usb_config_descriptor *p = get_usb_config_descriptor(v);
int i;
VALUE interface = rb_ary_new2(p->bNumInterfaces);
for (i = 0; i < p->bNumInterfaces; i++)
rb_ary_store(interface, i, rusb_interface_make(&p->interface[i], v));
return interface;
}
|
#revoked? ⇒ Boolean
USB::Configuration#revoked?
273 274 275 276 277 |
# File 'ext/usb/usb.c', line 273
static VALUE
rusb_config_revoked_p(VALUE v)
{
return RTEST(!check_usb_config_descriptor(v));
}
|
#settings ⇒ Object
315 |
# File 'lib/usb.rb', line 315 def settings() self.interfaces.map {|d| d.settings }.flatten end |
#wTotalLength ⇒ Object
USB::Configuration#wTotalLength
289 |
# File 'ext/usb/usb.c', line 289
static VALUE rusb_config_wTotalLength(VALUE v) { return INT2FIX(get_usb_config_descriptor(v)->wTotalLength); }
|