com.digi.xbee.api.packet.common

## Class ATCommandQueuePacket

- java.lang.Object
- - com.digi.xbee.api.packet.XBeePacket
  - - com.digi.xbee.api.packet.XBeeAPIPacket
    - - com.digi.xbee.api.packet.common.ATCommandQueuePacket

-     public class ATCommandQueuePacket
      extends XBeeAPIPacket

  This class represents an AT Command Queue XBee packet. Packet is built using the parameters of the constructor or providing a valid API payload.

  Used to query or set module parameters on the local device. In contrast to the `ATCommandPacket` API packet, new parameter values are queued and not applied until either an `ATCommandPacket` is sent or the `applyChanges()` method of the `XBeeDevice` is issued.

  Register queries (reading parameter values) are returned immediately.

  Command response is received as an `ATCommandResponsePacket`.

  See Also:
    `ATCommandPacket`, `ATCommandResponsePacket`, `XBeeAPIPacket`

- - ### Field Summary

    - ### Fields inherited from class com.digi.xbee.api.packet.XBeeAPIPacket

      `NO_FRAME_ID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ATCommandQueuePacket(int frameID, String command, byte[] parameter)` Class constructor.
    `ATCommandQueuePacket(int frameID, String command, String parameter)` Class constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static ATCommandQueuePacket` | `createPacket(byte[] payload)` Creates a new `ATCommandQueuePacket` object from the given payload.
    `LinkedHashMap<String,String>` | `getAPIPacketParameters()` Returns a map with the XBee packet parameters and their values.
    `String` | `getCommand()` Returns the AT command.
    `byte[]` | `getParameter()` Returns the AT command parameter.
    `String` | `getParameterAsString()` Returns the AT command parameter as String.
    `boolean` | `needsAPIFrameID()` Returns whether the API packet needs API Frame ID or not.
    `void` | `setParameter(byte[] parameter)` Sets the AT command parameter.
    `void` | `setParameter(String parameter)` Sets the AT command parameter as String.

    - ### Methods inherited from class com.digi.xbee.api.packet.XBeeAPIPacket

      `checkFrameID, getAPIData, getFrameID, getFrameType, getFrameTypeValue, getPacketData, isBroadcast, setFrameID`

    - ### Methods inherited from class com.digi.xbee.api.packet.XBeePacket

      `generateByteArray, generateByteArrayEscaped, getChecksum, getPacketLength, getParameters, parsePacket, parsePacket, toPrettyString, toString`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### ATCommandQueuePacket

          public ATCommandQueuePacket(int frameID,
                              String command,
                              byte[] parameter)

      Class constructor. Instantiates a new `ATCommandQueuePacket` object with the given parameters.
      Parameters:
        `frameID` - XBee API frame ID.
        `command` - AT command.
        `parameter` - AT command parameter `null` if it is not required.
      Throws:
        `IllegalArgumentException` - if `frameID < 0` or if `frameID > 255`.
        `NullPointerException` - if `command == null`.

    - #### ATCommandQueuePacket

          public ATCommandQueuePacket(int frameID,
                              String command,
                              String parameter)

      Class constructor. Instantiates a new `ATCommandQueuePacket` object with the given parameters.
      Parameters:
        `frameID` - XBee API frame ID.
        `command` - AT command.
        `parameter` - AT command parameter as String, `null` if it is not required.
      Throws:
        `IllegalArgumentException` - if `frameID < 0` or if `frameID > 255`.
        `NullPointerException` - if `command == null`.

  - ### Method Detail

    - #### createPacket

          public static ATCommandQueuePacket createPacket(byte[] payload)

      Creates a new `ATCommandQueuePacket` object from the given payload.
      Parameters:
        `payload` - The API frame payload. It must start with the frame type corresponding to a AT Command Queue packet (`0x09`). The byte array must be in `OperatingMode.API` mode.
      Returns:
        Parsed AT Command Queue packet.
      Throws:
        `IllegalArgumentException` - if `payload[0] != APIFrameType.AT_COMMAND_QUEUE.getValue()` or if `payload.length <` or if `frameID < 0` or if `frameID > 255`.
        `NullPointerException` - if `payload == null`.

    - #### getAPIPacketParameters

          public LinkedHashMap<String,String> getAPIPacketParameters()

      Description copied from class: `XBeeAPIPacket`
      Returns a map with the XBee packet parameters and their values.
      Returns:
        A sorted map containing the XBee packet parameters with their values.

    - #### getCommand

          public String getCommand()

      Returns the AT command.
      Returns:
        The AT command.

    - #### getParameter

          public byte[] getParameter()

      Returns the AT command parameter.
      Returns:
        The AT command parameter.

    - #### getParameterAsString

          public String getParameterAsString()

      Returns the AT command parameter as String.
      Returns:
        The AT command parameter as String, `null` if no parameter is set.

    - #### needsAPIFrameID

          public boolean needsAPIFrameID()

      Description copied from class: `XBeeAPIPacket`
      Returns whether the API packet needs API Frame ID or not.
      Specified by:
        `needsAPIFrameID` in class `XBeeAPIPacket`
      Returns:
        `true` if the packet needs API Frame ID, `false` otherwise.

    - #### setParameter

          public void setParameter(byte[] parameter)

      Sets the AT command parameter.
      Parameters:
        `parameter` - The AT command parameter.

    - #### setParameter

          public void setParameter(String parameter)

      Sets the AT command parameter as String.
      Parameters:
        `parameter` - The AT command parameter as String.

© Copyright 2014–2014 Digi International Inc. All rights reserved.