com.digi.xbee.api.models

## Class XBeeMessage

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

-     public class XBeeMessage
      extends Object

  This class represents an XBee message containing the remote XBee device the message belongs to, the content (data) of the message and a flag indicating if the message is a broadcast message (was received or is being sent via broadcast).

  This class is used within the XBee Java Library to read data sent by remote devices.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `XBeeMessage(RemoteXBeeDevice remoteXBeeDevice, byte[] data)` Class constructor.
    `XBeeMessage(RemoteXBeeDevice remoteXBeeDevice, byte[] data, boolean isBroadcast)` Class constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte[]` | `getData()` Returns the a byte array containing the data of the message.
    `String` | `getDataString()` Returns the data of the message in string format.
    `RemoteXBeeDevice` | `getDevice()` Returns the remote XBee device this message is associated to.
    `boolean` | `isBroadcast()` Returns whether or not the message was received via broadcast.

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

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

- - ### Constructor Detail

    - #### XBeeMessage

          public XBeeMessage(RemoteXBeeDevice remoteXBeeDevice,
                     byte[] data)

      Class constructor. Instantiates a new object of type `XBeeMessage` with the given parameters.
      Parameters:
        `remoteXBeeDevice` - The remote XBee device the message belongs to.
        `data` - Byte array containing the data of the message.
      Throws:
        `NullPointerException` - if `address == null` or if `data == null`.
      See Also:
        `RemoteXBeeDevice`

    - #### XBeeMessage

          public XBeeMessage(RemoteXBeeDevice remoteXBeeDevice,
                     byte[] data,
                     boolean isBroadcast)

      Class constructor. Instantiates a new object of type `XBeeMessage` with the given parameters.
      Parameters:
        `remoteXBeeDevice` - The remote XBee device the message belongs to.
        `data` - Byte array containing the data of the message.
        `isBroadcast` - Indicates if the message was received via broadcast.
      Throws:
        `NullPointerException` - if `xbeeAddress == null` or if `data == null`.
      See Also:
        `RemoteXBeeDevice`

  - ### Method Detail

    - #### getData

          public byte[] getData()

      Returns the a byte array containing the data of the message.
      Returns:
        A byte array containing the data of the message.

    - #### getDataString

          public String getDataString()

      Returns the data of the message in string format.
      Returns:
        The data of the message in string format.

    - #### getDevice

          public RemoteXBeeDevice getDevice()

      Returns the remote XBee device this message is associated to.
      Returns:
        The remote XBee device this message is associated to.
      See Also:
        `RemoteXBeeDevice`

    - #### isBroadcast

          public boolean isBroadcast()

      Returns whether or not the message was received via broadcast.
      Returns:
        `true` if the message was received via broadcast, `false` otherwise.

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