Class: XBee::Frames::ATCommand

Inherits:
IdentifiedFrame show all
Defined in:
lib/xbee/frames/at_command.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).

Direct Known Subclasses

ATCommandQueueParameterValue

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

Returns a new instance of ATCommand.



19
20
21
22
23
24
25
26
27
# File 'lib/xbee/frames/at_command.rb', line 19

def initialize(packet: nil)
	super

	if @parse_bytes
		@command_bytes = @parse_bytes.shift 2
		@parameter_bytes = @parse_bytes
		@parse_bytes = []
	end
end

Instance Attribute Details

#command_bytesObject

Returns the value of attribute command_bytes.



13
14
15
# File 'lib/xbee/frames/at_command.rb', line 13

def command_bytes
  @command_bytes
end

#parameter_bytesObject

attr_accessor :command



15
16
17
# File 'lib/xbee/frames/at_command.rb', line 15

def parameter_bytes
  @parameter_bytes
end

Instance Method Details

#bytesObject



30
31
32
# File 'lib/xbee/frames/at_command.rb', line 30

def bytes
	super + command_bytes + (parameter_bytes || [])
end