Class: XBee::Frames::RemoteATCommandResponse
- Inherits:
-
AddressedFrame
- Object
- Frame
- IdentifiedFrame
- AddressedFrame
- XBee::Frames::RemoteATCommandResponse
- Defined in:
- lib/xbee/frames/remote_at_command_response.rb
Overview
If a device receives this frame in response to a Remote Command Request (0x17) frame, the device sends an AT Command Response (0x97) frame out the serial interface. Some commands, such as the ND command, may send back multiple frames.
Constant Summary collapse
- STATUS =
Possible values for
status { 0 => :ok, 1 => :error, 2 => :invalid_command, 3 => :invalid_parameter, 4 => :transmission_failed, }.freeze
Instance Attribute Summary collapse
-
#at_command ⇒ Object
Returns the value of attribute at_command.
-
#data ⇒ Object
Returns the value of attribute data.
-
#status ⇒ Object
Returns the value of attribute status.
Attributes inherited from AddressedFrame
Attributes inherited from IdentifiedFrame
Attributes inherited from Frame
Instance Method Summary collapse
- #bytes ⇒ Object
-
#initialize(packet: nil) ⇒ RemoteATCommandResponse
constructor
A new instance of RemoteATCommandResponse.
Methods inherited from Frame
api_id, from_packet, #to_packet
Constructor Details
#initialize(packet: nil) ⇒ RemoteATCommandResponse
Returns a new instance of RemoteATCommandResponse.
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/xbee/frames/remote_at_command_response.rb', line 27 def initialize(packet: nil) super if @parse_bytes @at_command = @parse_bytes.shift 2 @status = @parse_bytes.shift @data = @parse_bytes @parse_bytes = [] end end |
Instance Attribute Details
#at_command ⇒ Object
Returns the value of attribute at_command.
12 13 14 |
# File 'lib/xbee/frames/remote_at_command_response.rb', line 12 def at_command @at_command end |
#data ⇒ Object
Returns the value of attribute data.
14 15 16 |
# File 'lib/xbee/frames/remote_at_command_response.rb', line 14 def data @data end |
#status ⇒ Object
Returns the value of attribute status.
13 14 15 |
# File 'lib/xbee/frames/remote_at_command_response.rb', line 13 def status @status end |
Instance Method Details
#bytes ⇒ Object
39 40 41 |
# File 'lib/xbee/frames/remote_at_command_response.rb', line 39 def bytes super + (command || [0x00] * 2) + [status || 0x00] + (data || []) end |