Class: XBee::Frames::AddressedFrame
- Inherits:
-
IdentifiedFrame
- Object
- Frame
- IdentifiedFrame
- XBee::Frames::AddressedFrame
- Defined in:
- lib/xbee/frames/addressed_frame.rb
Direct Known Subclasses
CreateSourceRoute, ExplicitAddressingCommand, RemoteATCommandRequest, RemoteATCommandResponse, TransmitRequest
Instance Attribute Summary collapse
-
#address16 ⇒ Object
Returns the value of attribute address16.
-
#address64 ⇒ Object
Returns the value of attribute address64.
Attributes inherited from IdentifiedFrame
Attributes inherited from Frame
Instance Method Summary collapse
- #bytes ⇒ Object
-
#initialize(packet: nil) ⇒ AddressedFrame
constructor
A new instance of AddressedFrame.
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
#address16 ⇒ Object
Returns the value of attribute address16.
8 9 10 |
# File 'lib/xbee/frames/addressed_frame.rb', line 8 def address16 @address16 end |
#address64 ⇒ Object
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
#bytes ⇒ Object
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 |