Class: XBee::Frames::ATCommandResponse
- Inherits:
-
IdentifiedFrame
- Object
- Frame
- IdentifiedFrame
- XBee::Frames::ATCommandResponse
- Defined in:
- lib/xbee/frames/at_command_response.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#data ⇒ Object
Returns the value of attribute data.
-
#status ⇒ Object
Returns the value of attribute status.
Attributes inherited from IdentifiedFrame
Attributes inherited from Frame
Instance Method Summary collapse
- #bytes ⇒ Object
-
#initialize(packet: nil) ⇒ ATCommandResponse
constructor
A new instance of ATCommandResponse.
Methods inherited from Frame
api_id, from_packet, #to_packet
Constructor Details
#initialize(packet: nil) ⇒ ATCommandResponse
Returns a new instance of ATCommandResponse.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/xbee/frames/at_command_response.rb', line 14 def initialize(packet: nil) super if @parse_bytes @command = @parse_bytes.shift 2 @status = @parse_bytes.shift @data = @parse_bytes @parse_bytes = [] end end |
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
9 10 11 |
# File 'lib/xbee/frames/at_command_response.rb', line 9 def command @command end |
#data ⇒ Object
Returns the value of attribute data.
11 12 13 |
# File 'lib/xbee/frames/at_command_response.rb', line 11 def data @data end |
#status ⇒ Object
Returns the value of attribute status.
10 11 12 |
# File 'lib/xbee/frames/at_command_response.rb', line 10 def status @status end |
Instance Method Details
#bytes ⇒ Object
26 27 28 |
# File 'lib/xbee/frames/at_command_response.rb', line 26 def bytes super + (command || [0x00] * 2) + [status || 0x00] + (data || []) end |