com.digi.xbee.api.models

## Class ATCommandResponse

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

-     public class ATCommandResponse
      extends Object

  This class represents the response of an AT Command sent by the connected XBee device or by a remote device after executing an AT Command.

  Among the executed command, this object contains the response data and the command status.

  See Also:
    `ATCommand`, `ATCommandStatus`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ATCommandResponse(ATCommand command)` Class constructor.
    `ATCommandResponse(ATCommand command, ATCommandStatus status)` Class constructor.
    `ATCommandResponse(ATCommand command, byte[] response)` Class constructor.
    `ATCommandResponse(ATCommand command, byte[] response, ATCommandStatus status)` Class constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ATCommand` | `getCommand()` Returns the AT command that generated the response.
    `byte[]` | `getResponse()` Returns the AT command response data in byte array format if any.
    `ATCommandStatus` | `getResponseStatus()` Returns the AT command response status.
    `String` | `getResponseString()` Returns the AT command response data as string if any.

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

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

- - ### Constructor Detail

    - #### ATCommandResponse

          public ATCommandResponse(ATCommand command)

      Class constructor. Instantiates a new object of type `ATCommandResponse` with the given parameters.
      Parameters:
        `command` - The `ATCommand` that generated the response.
      Throws:
        `NullPointerException` - if `command == null`.
      See Also:
        `ATCommand`

    - #### ATCommandResponse

          public ATCommandResponse(ATCommand command,
                           ATCommandStatus status)

      Class constructor. Instantiates a new object of type `ATCommandResponse` with the given parameters.
      Parameters:
        `command` - The `ATCommand` that generated the response.
        `status` - The `ATCommandStatus` containing the response status.
      Throws:
        `NullPointerException` - if `command == null` or if `status == null`.
      See Also:
        `ATCommand`, `ATCommandStatus`

    - #### ATCommandResponse

          public ATCommandResponse(ATCommand command,
                           byte[] response)

      Class constructor. Instantiates a new object of type `ATCommandResponse` with the given parameters.
      Parameters:
        `command` - The `ATCommand` that generated the response.
        `response` - The command response in byte array format.
      Throws:
        `NullPointerException` - if `command == null` or if `response == null`.
      See Also:
        `ATCommand`

    - #### ATCommandResponse

          public ATCommandResponse(ATCommand command,
                           byte[] response,
                           ATCommandStatus status)

      Class constructor. Instantiates a new object of type `ATCommandResponse` with the given parameters.
      Parameters:
        `command` - The `ATCommand` that generated the response.
        `response` - The command response in byte array format.
        `status` - The `ATCommandStatus` containing the response status.
      Throws:
        `NullPointerException` - if `command == null` or if `status == null`.
      See Also:
        `ATCommand`, `ATCommandStatus`

  - ### Method Detail

    - #### getCommand

          public ATCommand getCommand()

      Returns the AT command that generated the response.
      Returns:
        The AT command that generated the response.
      See Also:
        `ATCommand`

    - #### getResponse

          public byte[] getResponse()

      Returns the AT command response data in byte array format if any.
      Returns:
        The AT command response data in byte array format, `null` if there is not response data.

    - #### getResponseStatus

          public ATCommandStatus getResponseStatus()

      Returns the AT command response status.
      Returns:
        The AT command response status.
      See Also:
        `ATCommandStatus`

    - #### getResponseString

          public String getResponseString()

      Returns the AT command response data as string if any.
      Returns:
        The AT command response data as string, `null` if there is not response data.

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