Class: XBee::Frames::AddressedFrame

Inherits:
IdentifiedFrame show all
Defined in:
lib/xbee/frames/addressed_frame.rb

Instance Attribute Summary collapse

Attributes inherited from IdentifiedFrame

#id

Attributes inherited from Frame

#packet

Instance Method Summary collapse

Methods inherited from Frame

api_id, from_packet, #to_packet

Constructor Details

#initialize(packet: nil) ⇒ AddressedFrame

Returns a new instance of AddressedFrame.



12
13
14
15
16
17
18
19
# File 'lib/xbee/frames/addressed_frame.rb', line 12

def initialize(packet: nil)
	super

	if @parse_bytes
		@address64 = Address64.new *@parse_bytes.shift(8)
		@address16 = Address16.new *@parse_bytes.shift(2)
	end
end

Instance Attribute Details

#address16Object

Returns the value of attribute address16.



8
9
10
# File 'lib/xbee/frames/addressed_frame.rb', line 8

def address16
  @address16
end

#address64Object

Returns the value of attribute address64.



9
10
11
# File 'lib/xbee/frames/addressed_frame.rb', line 9

def address64
  @address64
end

Instance Method Details

#bytesObject



22
23
24
# File 'lib/xbee/frames/addressed_frame.rb', line 22

def bytes
	super + (address64 || Address64.from_array([0] * 8)).to_a + (address16 || Address16.new(0, 0)).to_a
end