Class: MTP::Protocol::EndPoints
- Inherits:
-
Object
- Object
- MTP::Protocol::EndPoints
- Defined in:
- lib/mtp/protocol.rb
Instance Attribute Summary collapse
-
#in ⇒ Object
readonly
Returns the value of attribute in.
-
#interrupt ⇒ Object
readonly
Returns the value of attribute interrupt.
-
#out ⇒ Object
readonly
Returns the value of attribute out.
Instance Method Summary collapse
-
#initialize(protocol) ⇒ EndPoints
constructor
A new instance of EndPoints.
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
#in ⇒ Object (readonly)
Returns the value of attribute in.
14 15 16 |
# File 'lib/mtp/protocol.rb', line 14 def in @in end |
#interrupt ⇒ Object (readonly)
Returns the value of attribute interrupt.
14 15 16 |
# File 'lib/mtp/protocol.rb', line 14 def interrupt @interrupt end |
#out ⇒ Object (readonly)
Returns the value of attribute out.
14 15 16 |
# File 'lib/mtp/protocol.rb', line 14 def out @out end |