com.digi.xbee.api.models

## Class XBee16BitAddress

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

-     public final class XBee16BitAddress
      extends Object

  This class represents a 16-bit network address.

  This address is only applicable for:

  - 802.15.4
  - ZigBee
  - ZNet 2.5
  - XTend (Legacy)

  DigiMesh and Point-to-Multipoint protocols don't support 16-bit addressing.

  Each device has its own 16-bit address which is unique in the network. It is automatically assigned when the radio joins the network for ZigBee and ZNet 2.5, and manually configured in 802.15.4 radios.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static XBee16BitAddress` | `BROADCAST_ADDRESS` 16-bit broadcast address (value: FFFF).
    `static XBee16BitAddress` | `COORDINATOR_ADDRESS` 16-bit address reserved for the coordinator (value: 0000).
    `static XBee16BitAddress` | `UNKNOWN_ADDRESS` 16-bit unknown address (value: FFFE).

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `XBee16BitAddress(byte[] address)` Class constructor.
    `XBee16BitAddress(int hsb, int lsb)` Class constructor.
    `XBee16BitAddress(String address)` Class constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `int` | `getHsb()` Returns the address high significant byte.
    `int` | `getLsb()` Returns the address low significant byte.
    `byte[]` | `getValue()` Returns the 16-bit address value in byte array format.
    `int` | `hashCode()`
    `String` | `toString()`

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

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### BROADCAST_ADDRESS

          public static final XBee16BitAddress BROADCAST_ADDRESS

      16-bit broadcast address (value: FFFF).

    - #### COORDINATOR_ADDRESS

          public static final XBee16BitAddress COORDINATOR_ADDRESS

      16-bit address reserved for the coordinator (value: 0000).

    - #### UNKNOWN_ADDRESS

          public static final XBee16BitAddress UNKNOWN_ADDRESS

      16-bit unknown address (value: FFFE).

  - ### Constructor Detail

    - #### XBee16BitAddress

          public XBee16BitAddress(byte[] address)

      Class constructor. Instantiates a new object of type `XBee16BitAddress` with the given parameters.
      Parameters:
        `address` - The 16-bit address as byte array.
      Throws:
        `IllegalArgumentException` - if `address.length < 1` or if `address.length > 2`.
        `NullPointerException` - if `address == null`.

    - #### XBee16BitAddress

          public XBee16BitAddress(int hsb,
                          int lsb)

      Class constructor. Instantiates a new object of type `XBee16BitAddress` with the given parameters.
      Parameters:
        `hsb` - High significant byte of the address.
        `lsb` - Low significant byte of the address.
      Throws:
        `IllegalArgumentException` - if `hsb > 255` or if `hsb < 0` or if `lsb > 255` or if `lsb < 0`.

    - #### XBee16BitAddress

          public XBee16BitAddress(String address)

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

      The string must be the hexadecimal representation of a 16-bit address.

      Parameters:
        `address` - String containing the 16-bit address.
      Throws:
        `IllegalArgumentException` - if `address.length() < 1` or if `address` contains non-hexadecimal characters and is longer than 8 bytes.
        `NullPointerException` - if `address == null`.

  - ### Method Detail

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### getHsb

          public int getHsb()

      Returns the address high significant byte.
      Returns:
        Address high significant byte.

    - #### getLsb

          public int getLsb()

      Returns the address low significant byte.
      Returns:
        Address low significant byte.

    - #### getValue

          public byte[] getValue()

      Returns the 16-bit address value in byte array format.
      Returns:
        Address value as byte array.

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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