class XBee::Frames::RemoteATCommandRequest

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).

Constants

OPTIONS

Attributes

at_command[RW]
command_parameter[RW]
remote_command_options[RW]

Public Class Methods

new(packet: nil) click to toggle source
Calls superclass method XBee::Frames::AddressedFrame::new
# 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

Public Instance Methods

at_command=(value) click to toggle source

@param value [Array/String] The AT command. Must be two bytes, either an array or a string.

# File lib/xbee/frames/remote_at_command_request.rb, line 38
def at_command=(value)
        raise ArgumentError, "AT command must be exactly two bytes (got #{value.inspect})" unless value.length == 2
        if value.respond_to?(:force_encoding)
                @at_command = value.dup.force_encoding('ASCII').unpack 'C*'
        else
                @at_command = value
        end
end
bytes() click to toggle source
Calls superclass method XBee::Frames::AddressedFrame#bytes
# 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