Class: XBeeRuby::RxResponse

Inherits:
Response show all
Defined in:
lib/xbee-ruby/rx_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Response

frame_type, from_packet

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

#address16Object (readonly)

Returns the value of attribute address16.



21
22
23
# File 'lib/xbee-ruby/rx_response.rb', line 21

def address16
  @address16
end

#address64Object (readonly)

Returns the value of attribute address64.



20
21
22
# File 'lib/xbee-ruby/rx_response.rb', line 20

def address64
  @address64
end

#dataObject (readonly)

Returns the value of attribute data.



23
24
25
# File 'lib/xbee-ruby/rx_response.rb', line 23

def data
  @data
end

#receive_optionsObject (readonly)

Returns the value of attribute receive_options.



22
23
24
# File 'lib/xbee-ruby/rx_response.rb', line 22

def receive_options
  @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.receive_options == other.receive_options
end

#to_sObject



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=#{receive_options})"
end