com.digi.xbee.api.models

## Class ATCommand

- java.lang.Object
- - com.digi.xbee.api.models.ATCommand

-     public class ATCommand
      extends Object

  This class represents an AT command used to read or set different properties of the XBee device.

  AT commands can be sent directly to the connected device or to remote devices and may have parameters.

  After executing an AT Command, an AT Response is received from the device.

  See Also:
    `ATCommandResponse`

- - ### Constructor Summary

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

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getCommand()` Returns the AT command alias.
    `byte[]` | `getParameter()` Returns the AT command parameter.
    `String` | `getParameterString()` Returns the AT command parameter in string format.
    `void` | `setParameter(byte[] parameter)` Sets the AT command parameter as byte array.
    `void` | `setParameter(String parameter)` Sets the AT command parameter as string.

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

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

- - ### Constructor Detail

    - #### ATCommand

          public ATCommand(String command)

      Class constructor. Instantiates a new object of type `ATCommand` with the given parameters.
      Parameters:
        `command` - The AT Command alias.
      Throws:
        `IllegalArgumentException` - if `command.length() != 2`.
        `NullPointerException` - if `command == null`.

    - #### ATCommand

          public ATCommand(String command,
                   byte[] parameter)

      Class constructor. Instantiates a new object of type `ATCommand` with the given parameters.

      If not parameter is required the constructor `ATCommand(String)` is recommended.

      Parameters:
        `command` - The AT Command alias.
        `parameter` - The command parameter as byte array.
      Throws:
        `IllegalArgumentException` - if `command.length() != 2`.
        `NullPointerException` - if `command == null`.

    - #### ATCommand

          public ATCommand(String command,
                   String parameter)

      Class constructor. Instantiates a new object of type `ATCommand` with the given parameters.

      If not parameter is required the constructor `ATCommand(String)` is recommended.

      Parameters:
        `command` - The AT Command alias.
        `parameter` - The command parameter as string.
      Throws:
        `IllegalArgumentException` - if `command.length() != 2`.
        `NullPointerException` - if `command == null`.

  - ### Method Detail

    - #### getCommand

          public String getCommand()

      Returns the AT command alias.
      Returns:
        The AT command alias.

    - #### getParameter

          public byte[] getParameter()

      Returns the AT command parameter.
      Returns:
        The AT command parameter, `null` if the command does not have a parameter.

    - #### getParameterString

          public String getParameterString()

      Returns the AT command parameter in string format.
      Returns:
        The AT command parameter, `null` if the command does not have a parameter.

    - #### setParameter

          public void setParameter(byte[] parameter)

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

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