Class: XBeeRuby::TxResponse

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Response

frame_type, from_packet

Constructor Details

#initialize(bytes) ⇒ TxResponse

Returns a new instance of TxResponse.



25
26
27
28
29
30
31
# File 'lib/xbee-ruby/tx_response.rb', line 25

def initialize bytes
	@frame_id = bytes[1]
	@address16 = Address16.new *bytes[2..3]
	@retry_count = bytes[4]
	@delivery_status = bytes[5]
	@discovery_status = bytes[6]
end

Instance Attribute Details

#address16Object (readonly)

Returns the value of attribute address16.



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

def address16
  @address16
end

#delivery_statusObject (readonly)

Returns the value of attribute delivery_status.



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

def delivery_status
  @delivery_status
end

#discovery_statusObject (readonly)

Returns the value of attribute discovery_status.



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

def discovery_status
  @discovery_status
end

#frame_idObject (readonly)

Returns the value of attribute frame_id.



19
20
21
# File 'lib/xbee-ruby/tx_response.rb', line 19

def frame_id
  @frame_id
end

#retry_countObject (readonly)

Returns the value of attribute retry_count.



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

def retry_count
  @retry_count
end

Instance Method Details

#==(other) ⇒ Object



33
34
35
36
37
# File 'lib/xbee-ruby/tx_response.rb', line 33

def == other
	other.class == TxResponse && self.address16 == other.address16 &&
			self.retry_count == other.retry_count && self.delivery_status == other.delivery_status &&
			self.discovery_status == other.discovery_status
end

#to_sObject



39
40
41
42
# File 'lib/xbee-ruby/tx_response.rb', line 39

def to_s
	"TxResponse[#{super}](address16=0x#{address16}, retry_count=#{retry_count}, " +
			"delivery_status=#{delivery_status}, discovery_status=#{discovery_status})"
end