Class: MTP::Protocol::EndPoints

Inherits:
Object
  • Object
show all
Defined in:
lib/mtp/protocol.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(protocol) ⇒ EndPoints

Returns a new instance of EndPoints.



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/mtp/protocol.rb', line 15

def initialize(protocol)
  protocol.interface.endpoints.each do |ep|
    if (ep.bEndpointAddress & 0b10000000).zero?
      @out = ep
    else
      if ep.bmAttributes == 0x02
        @in = ep
      elsif ep.bmAttributes == 0x03
        @interrupt = ep
      end            
    end
  end
end

Instance Attribute Details

#inObject (readonly)

Returns the value of attribute in.



14
15
16
# File 'lib/mtp/protocol.rb', line 14

def in
  @in
end

#interruptObject (readonly)

Returns the value of attribute interrupt.



14
15
16
# File 'lib/mtp/protocol.rb', line 14

def interrupt
  @interrupt
end

#outObject (readonly)

Returns the value of attribute out.



14
15
16
# File 'lib/mtp/protocol.rb', line 14

def out
  @out
end