Class: USB::Endpoint
- Inherits:
-
Data
- Object
- Data
- USB::Endpoint
- Defined in:
- lib/usb.rb,
ext/usb/usb.c
Instance Method Summary collapse
-
#bDescriptorType ⇒ Object
USB::Endpoint#bDescriptorType.
-
#bEndpointAddress ⇒ Object
USB::Endpoint#bEndpointAddress.
-
#bInterval ⇒ Object
USB::Endpoint#bInterval.
-
#bLength ⇒ Object
USB::Endpoint#bLength.
-
#bmAttributes ⇒ Object
USB::Endpoint#bmAttributes.
-
#bRefresh ⇒ Object
USB::Endpoint#bRefresh.
-
#bSynchAddress ⇒ Object
USB::Endpoint#bSynchAddress.
- #bus ⇒ Object
- #configuration ⇒ Object
- #device ⇒ Object
- #inspect ⇒ Object
- #interface ⇒ Object
-
#revoked? ⇒ Boolean
USB::Endpoint#revoked?.
-
#setting ⇒ Object
USB::Endpoint#setting.
-
#wMaxPacketSize ⇒ Object
USB::Endpoint#wMaxPacketSize.
Instance Method Details
#bDescriptorType ⇒ Object
USB::Endpoint#bDescriptorType
412 |
# File 'ext/usb/usb.c', line 412
static VALUE rusb_endpoint_bDescriptorType(VALUE v) { return INT2FIX(get_usb_endpoint_descriptor(v)->bDescriptorType); }
|
#bEndpointAddress ⇒ Object
USB::Endpoint#bEndpointAddress
415 |
# File 'ext/usb/usb.c', line 415
static VALUE rusb_endpoint_bEndpointAddress(VALUE v) { return INT2FIX(get_usb_endpoint_descriptor(v)->bEndpointAddress); }
|
#bInterval ⇒ Object
USB::Endpoint#bInterval
424 |
# File 'ext/usb/usb.c', line 424
static VALUE rusb_endpoint_bInterval(VALUE v) { return INT2FIX(get_usb_endpoint_descriptor(v)->bInterval); }
|
#bLength ⇒ Object
USB::Endpoint#bLength
409 |
# File 'ext/usb/usb.c', line 409
static VALUE rusb_endpoint_bLength(VALUE v) { return INT2FIX(get_usb_endpoint_descriptor(v)->bLength); }
|
#bmAttributes ⇒ Object
USB::Endpoint#bmAttributes
418 |
# File 'ext/usb/usb.c', line 418
static VALUE rusb_endpoint_bmAttributes(VALUE v) { return INT2FIX(get_usb_endpoint_descriptor(v)->bmAttributes); }
|
#bRefresh ⇒ Object
USB::Endpoint#bRefresh
427 |
# File 'ext/usb/usb.c', line 427
static VALUE rusb_endpoint_bRefresh(VALUE v) { return INT2FIX(get_usb_endpoint_descriptor(v)->bRefresh); }
|
#bSynchAddress ⇒ Object
USB::Endpoint#bSynchAddress
430 |
# File 'ext/usb/usb.c', line 430
static VALUE rusb_endpoint_bSynchAddress(VALUE v) { return INT2FIX(get_usb_endpoint_descriptor(v)->bSynchAddress); }
|
#bus ⇒ Object
379 |
# File 'lib/usb.rb', line 379 def bus() self.setting.interface.configuration.device.bus end |
#configuration ⇒ Object
381 |
# File 'lib/usb.rb', line 381 def configuration() self.setting.interface.configuration end |
#device ⇒ Object
380 |
# File 'lib/usb.rb', line 380 def device() self.setting.interface.configuration.device end |
#inspect ⇒ Object
360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 |
# File 'lib/usb.rb', line 360 def inspect if self.revoked? "\#<#{self.class} revoked>" else endpoint_address = self.bEndpointAddress num = endpoint_address & 0b00001111 inout = (endpoint_address & 0b10000000) == 0 ? "OUT" : "IN " bits = self.bmAttributes transfer_type = %w[Control Isochronous Bulk Interrupt][0b11 & bits] type = [transfer_type] if transfer_type == 'Isochronous' synchronization_type = %w[NoSynchronization Asynchronous Adaptive Synchronous][(0b1100 & bits) >> 2] usage_type = %w[Data Feedback ImplicitFeedback ?][(0b110000 & bits) >> 4] type << synchronization_type << usage_type end "\#<#{self.class} #{num} #{inout} #{type.join(" ")}>" end end |
#interface ⇒ Object
382 |
# File 'lib/usb.rb', line 382 def interface() self.setting.interface end |
#revoked? ⇒ Boolean
USB::Endpoint#revoked?
399 400 401 402 403 |
# File 'ext/usb/usb.c', line 399
static VALUE
rusb_endpoint_revoked_p(VALUE v)
{
return RTEST(!check_usb_endpoint_descriptor(v));
}
|
#setting ⇒ Object
USB::Endpoint#setting
406 |
# File 'ext/usb/usb.c', line 406
static VALUE rusb_endpoint_setting(VALUE v) { return get_rusb_endpoint_descriptor(v)->parent; }
|
#wMaxPacketSize ⇒ Object
USB::Endpoint#wMaxPacketSize
421 |
# File 'ext/usb/usb.c', line 421
static VALUE rusb_endpoint_wMaxPacketSize(VALUE v) { return INT2FIX(get_usb_endpoint_descriptor(v)->wMaxPacketSize); }
|