com.digi.xbee.api.packet.common

## Class IODataSampleRxIndicatorPacket

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

-     public class IODataSampleRxIndicatorPacket
      extends XBeeAPIPacket

  This class represents an IO Data Sample RX Indicator packet. Packet is built using the parameters of the constructor or providing a valid API payload.

  When the module receives an IO sample frame from a remote device, it sends the sample out the UART using this frame type (when AO=0). Only modules running API firmware will send IO samples out the UART.

  Among received data, some options can also be received indicating transmission parameters.

  See Also:
    `XBeeReceiveOptions`, `XBeeAPIPacket`

- - ### Field Summary

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

      `NO_FRAME_ID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `IODataSampleRxIndicatorPacket(XBee64BitAddress sourceAddress64, XBee16BitAddress sourceAddress16, int receiveOptions, byte[] rfData)` Class constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static IODataSampleRxIndicatorPacket` | `createPacket(byte[] payload)` Creates a new `IODataSampleRxIndicatorPacket` object from the given payload.
    `XBee16BitAddress` | `get16bitSourceAddress()` Returns the 16-bit sender/source address.
    `XBee64BitAddress` | `get64bitSourceAddress()` Returns the 64-bit sender/source address.
    `LinkedHashMap<String,String>` | `getAPIPacketParameters()` Returns a map with the XBee packet parameters and their values.
    `IOSample` | `getIOSample()` Returns the IO sample corresponding to the data contained in the packet.
    `int` | `getReceiveOptions()` Returns the receive options.
    `byte[]` | `getRFData()` Returns the received RF data.
    `boolean` | `isBroadcast()` Returns whether or not the packet is a broadcast packet.
    `boolean` | `needsAPIFrameID()` Returns whether the API packet needs API Frame ID or not.
    `void` | `setRFData(byte[] rfData)` Sets the received RF data.

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

      `checkFrameID, getAPIData, getFrameID, getFrameType, getFrameTypeValue, getPacketData, 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

    - #### IODataSampleRxIndicatorPacket

          public IODataSampleRxIndicatorPacket(XBee64BitAddress sourceAddress64,
                                       XBee16BitAddress sourceAddress16,
                                       int receiveOptions,
                                       byte[] rfData)

      Class constructor. Instantiates a new `IODataSampleRxIndicatorPacket` object with the given parameters.
      Parameters:
        `sourceAddress64` - 64-bit address of the sender.
        `sourceAddress16` - 16-bit address of the sender.
        `receiveOptions` - Receive options.
        `rfData` - Received RF data.
      Throws:
        `IllegalArgumentException` - if `receiveOptions < 0` or if `receiveOptions > 255` or if `rfData.length < 5`.
        `NullPointerException` - if `sourceAddress64 == null` or if `sourceAddress16 == null`.
      See Also:
        `XBeeReceiveOptions`, `XBee16BitAddress`, `XBee64BitAddress`

  - ### Method Detail

    - #### createPacket

          public static IODataSampleRxIndicatorPacket createPacket(byte[] payload)

      Creates a new `IODataSampleRxIndicatorPacket` object from the given payload.
      Parameters:
        `payload` - The API frame payload. It must start with the frame type corresponding to a IO Data Sample RX Indicator packet (`0x92`). The byte array must be in `OperatingMode.API` mode.
      Returns:
        Parsed ZigBee Receive packet.
      Throws:
        `IllegalArgumentException` - if `payload[0] != APIFrameType.IO_DATA_SAMPLE_RX_INDICATOR.getValue()` or if `payload.length <` or if `receiveOptions < 0` or if `receiveOptions > 255` or if `rfData.length < 5`.
        `NullPointerException` - if `payload == null`.

    - #### get16bitSourceAddress

          public XBee16BitAddress get16bitSourceAddress()

      Returns the 16-bit sender/source address.
      Returns:
        16-bit sender/source address.
      See Also:
        `XBee16BitAddress`

    - #### get64bitSourceAddress

          public XBee64BitAddress get64bitSourceAddress()

      Returns the 64-bit sender/source address.
      Returns:
        The 64-bit sender/source address.
      See Also:
        `XBee64BitAddress`

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

    - #### getIOSample

          public IOSample getIOSample()

      Returns the IO sample corresponding to the data contained in the packet.
      Returns:
        The IO sample of the packet, null if the packet has not any data or if the sample could not be generated correctly.
      See Also:
        `IOSample`

    - #### getReceiveOptions

          public int getReceiveOptions()

      Returns the receive options.
      Returns:
        Receive options.
      See Also:
        `XBeeReceiveOptions`

    - #### getRFData

          public byte[] getRFData()

      Returns the received RF data.
      Returns:
        Received RF data.

    - #### isBroadcast

          public boolean isBroadcast()

      Description copied from class: `XBeeAPIPacket`
      Returns whether or not the packet is a broadcast packet.
      Overrides:
        `isBroadcast` in class `XBeeAPIPacket`
      Returns:
        `true` if the packet is a broadcast packet, `false` otherwise.

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

    - #### setRFData

          public void setRFData(byte[] rfData)

      Sets the received RF data.
      Parameters:
        `rfData` - Received RF data.

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