Class: XBeeRuby::RxResponse
- Defined in:
- lib/xbee-ruby/rx_response.rb
Instance Attribute Summary collapse
-
#address16 ⇒ Object
readonly
Returns the value of attribute address16.
-
#address64 ⇒ Object
readonly
Returns the value of attribute address64.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#receive_options ⇒ Object
readonly
Returns the value of attribute receive_options.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(bytes) ⇒ RxResponse
constructor
A new instance of RxResponse.
- #to_s ⇒ Object
Methods inherited from Response
Constructor Details
#initialize(bytes) ⇒ RxResponse
Returns a new instance of RxResponse.
25 26 27 28 29 30 |
# File 'lib/xbee-ruby/rx_response.rb', line 25 def initialize bytes @address64 = Address64.new *bytes[1..8] @address16 = Address16.new *bytes[9..10] @receive_options = bytes[11] @data = bytes[12..-1] end |
Instance Attribute Details
#address16 ⇒ Object (readonly)
Returns the value of attribute address16.
21 22 23 |
# File 'lib/xbee-ruby/rx_response.rb', line 21 def address16 @address16 end |
#address64 ⇒ Object (readonly)
Returns the value of attribute address64.
20 21 22 |
# File 'lib/xbee-ruby/rx_response.rb', line 20 def address64 @address64 end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
23 24 25 |
# File 'lib/xbee-ruby/rx_response.rb', line 23 def data @data end |
#receive_options ⇒ Object (readonly)
Returns the value of attribute receive_options.
22 23 24 |
# File 'lib/xbee-ruby/rx_response.rb', line 22 def @receive_options end |
Instance Method Details
#==(other) ⇒ Object
32 33 34 35 |
# File 'lib/xbee-ruby/rx_response.rb', line 32 def == other other.class == RxResponse && self.address64 == other.address64 && self.address16 == other.address16 && self. == other. end |
#to_s ⇒ Object
37 38 39 |
# File 'lib/xbee-ruby/rx_response.rb', line 37 def to_s "RxResponse[#{super}](address64=0x#{address64}, address16=0x#{address16}, receive_otions=#{})" end |