Class: LIBUSB::Interface
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- LIBUSB::Interface
- Includes:
- Comparable
- Defined in:
- lib/libusb/interface.rb
Instance Attribute Summary (collapse)
-
- (Configuration) configuration
readonly
The configuration this interface belongs to.
Instance Method Summary (collapse)
- - (Object) <=>(o)
- - (Object) alt_settings (also: #settings)
-
- (Object) bInterfaceNumber
Number of this interface.
-
- (Object) device
The Device this Interface belongs to.
-
- (Object) endpoints
Return all endpoints of all alternative settings as Array of Endpoints.
-
- (Interface) initialize(configuration, *args)
constructor
A new instance of Interface.
- - (Object) inspect
Constructor Details
- (Interface) initialize(configuration, *args)
A new instance of Interface
30 31 32 33 |
# File 'lib/libusb/interface.rb', line 30 def initialize(configuration, *args) @configuration = configuration super(*args) end |
Instance Attribute Details
- (Configuration) configuration (readonly)
The configuration this interface belongs to.
36 37 38 |
# File 'lib/libusb/interface.rb', line 36 def configuration @configuration end |
Instance Method Details
- (Object) <=>(o)
56 57 58 |
# File 'lib/libusb/interface.rb', line 56 def <=>(o) configuration<=>o.configuration end |
- (Object) alt_settings Also known as: settings
38 39 40 41 42 43 44 |
# File 'lib/libusb/interface.rb', line 38 def alt_settings ifs = [] self[:num_altsetting].times do |i| ifs << Setting.new(self, self[:altsetting] + i*Setting.size) end return ifs end |
- (Object) bInterfaceNumber
Number of this interface.
26 27 28 |
# File 'lib/libusb/interface.rb', line 26 def bInterfaceNumber settings.first.bInterfaceNumber end |
- (Object) device
The Device this Interface belongs to.
52 |
# File 'lib/libusb/interface.rb', line 52 def device() self.configuration.device end |
- (Object) endpoints
Return all endpoints of all alternative settings as Array of Endpoints.
54 |
# File 'lib/libusb/interface.rb', line 54 def endpoints() self.alt_settings.map {|d| d.endpoints }.flatten end |
- (Object) inspect
47 48 49 |
# File 'lib/libusb/interface.rb', line 47 def inspect "\#<#{self.class} #{bInterfaceNumber}>" end |