Class: XBee::Frames::RemoteATCommandRequest

Inherits:
AddressedFrame show all
Defined in:
lib/xbee/frames/remote_at_command_request.rb

Overview

Use this frame to query or set device parameters on the local device. This API command applies changes after running the command. You can query parameter values by sending the 0x08 AT Command frame with no parameter value field (the two-byte AT command is immediately followed by the frame checksum).

Constant Summary collapse

OPTIONS =
{
	0x01 => :disable_ack,
	0x40 => :extended_transmission_timeout,
}.freeze

Instance Attribute Summary collapse

Attributes inherited from AddressedFrame

#address16, #address64

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) ⇒ RemoteATCommandRequest

Returns a new instance of RemoteATCommandRequest.



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/xbee/frames/remote_at_command_request.rb', line 23

def initialize(packet: nil)
	@address16 = Address16::BROADCAST

	super

	if @parse_bytes
		@remote_command_options = @parse_bytes.shift
		@at_command = @parse_bytes.shift 2
		@command_parameter = @parse_bytes
		@parse_bytes = []
	end
end

Instance Attribute Details

#at_commandObject

Returns the value of attribute at_command.



18
19
20
# File 'lib/xbee/frames/remote_at_command_request.rb', line 18

def at_command
  @at_command
end

#command_parameterObject

Returns the value of attribute command_parameter.



19
20
21
# File 'lib/xbee/frames/remote_at_command_request.rb', line 19

def command_parameter
  @command_parameter
end

#remote_command_optionsObject

Returns the value of attribute remote_command_options.



20
21
22
# File 'lib/xbee/frames/remote_at_command_request.rb', line 20

def remote_command_options
  @remote_command_options
end

Instance Method Details

#bytesObject



48
49
50
# File 'lib/xbee/frames/remote_at_command_request.rb', line 48

def bytes
	super + [remote_command_options || 0x00] + (at_command || [0] * 2) + (command_parameter || [])
end