com.digi.xbee.api.packet.raw

## Class TX16Packet

- java.lang.Object
- - com.digi.xbee.api.packet.XBeePacket
  - - com.digi.xbee.api.packet.XBeeAPIPacket
    - - com.digi.xbee.api.packet.raw.TX16Packet

-     public class TX16Packet
      extends XBeeAPIPacket

  This class represents a TX (Transmit) 16 Request packet. Packet is built using the parameters of the constructor or providing a valid API payload.

  A TX Request message will cause the module to transmit data as an RF Packet.

  See Also:
    `XBeeAPIPacket`

- - ### Field Summary

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

      `NO_FRAME_ID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TX16Packet(int frameID, XBee16BitAddress destAddress16, int transmitOptions, byte[] rfData)` Class constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static TX16Packet` | `createPacket(byte[] payload)` Creates a new `TX16Packet` object from the given payload.
    `XBee16BitAddress` | `get16bitDestinationAddress()` Returns the 16-bit destination address.
    `LinkedHashMap<String,String>` | `getAPIPacketParameters()` Returns a map with the XBee packet parameters and their values.
    `byte[]` | `getRFData()` Returns the RF Data to send.
    `int` | `getTransmitOptions()` Returns the transmit options bitfield.
    `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 RF data to send.

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

    - #### TX16Packet

          public TX16Packet(int frameID,
                    XBee16BitAddress destAddress16,
                    int transmitOptions,
                    byte[] rfData)

      Class constructor. Instantiates a new `TX16Packet` object with the given parameters.
      Parameters:
        `frameID` - Frame ID.
        `destAddress16` - 16-bit address of the destination device.
        `transmitOptions` - Bitfield of supported transmission options.
        `rfData` - RF Data that is sent to the destination device.
      Throws:
        `IllegalArgumentException` - if `frameID < 0` or if `frameID > 255` or if `transmitOptions < 0` or if `transmitOptions > 255`.
        `NullPointerException` - if `destAddress == null`.
      See Also:
        `XBeeTransmitOptions`, `XBee16BitAddress`

  - ### Method Detail

    - #### createPacket

          public static TX16Packet createPacket(byte[] payload)

      Creates a new `TX16Packet` object from the given payload.
      Parameters:
        `payload` - The API frame payload. It must start with the frame type corresponding to a TX16 Request packet (`0x01`). The byte array must be in `OperatingMode.API` mode.
      Returns:
        Parsed TX (transmit) 16 Request packet.
      Throws:
        `IllegalArgumentException` - if `payload[0] != APIFrameType.TX_16.getValue()` or if `payload.length <` or if `frameID < 0` or if `frameID > 255` or if `transmitOptions < 0` or if `transmitOptions > 255`.
        `NullPointerException` - if `payload == null`.

    - #### get16bitDestinationAddress

          public XBee16BitAddress get16bitDestinationAddress()

      Returns the 16-bit destination address.
      Returns:
        The 16-bit destination address.
      See Also:
        `XBee16BitAddress`

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

    - #### getRFData

          public byte[] getRFData()

      Returns the RF Data to send.
      Returns:
        RF data to send.

    - #### getTransmitOptions

          public int getTransmitOptions()

      Returns the transmit options bitfield.
      Returns:
        Transmit options bitfield.
      See Also:
        `XBeeTransmitOptions`

    - #### 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 RF data to send.
      Parameters:
        `rfData` - RF Data to send.

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