com.digi.xbee.api

## Class Raw802Device

- java.lang.Object
- - com.digi.xbee.api.AbstractXBeeDevice
  - - com.digi.xbee.api.XBeeDevice
    - - com.digi.xbee.api.Raw802Device

-     public class Raw802Device
      extends XBeeDevice

  This class represents a local 802.15.4 device.
  See Also:
    `XBeeDevice`, `DigiMeshDevice`, `DigiPointDevice`, `ZigBeeDevice`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Raw802Device(IConnectionInterface connectionInterface)` Class constructor.
    `Raw802Device(String port, int baudRate)` Class constructor.
    `Raw802Device(String port, int baudRate, int dataBits, int stopBits, int parity, int flowControl)` Class constructor.
    `Raw802Device(String port, SerialPortParameters serialPortParameters)` Class constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `AssociationIndicationStatus` | `getAssociationIndicationStatus()` Returns the current association status of this XBee device.
    `XBeeNetwork` | `getNetwork()` Returns the network associated with this XBee device.
    `XBeeProtocol` | `getXBeeProtocol()` Returns the XBee Protocol of this XBee device.
    `void` | `open()` Opens the connection interface associated with this XBee device.
    `void` | `sendData(XBee16BitAddress address, byte[] data)` Sends the provided data to the XBee device of the network corresponding to the given 16-bit address.
    `void` | `sendData(XBee64BitAddress address, byte[] data)` Sends the provided data to the XBee device of the network corresponding to the given 64-bit address.
    `void` | `sendDataAsync(XBee16BitAddress address, byte[] data)` Sends the provided data to the XBee device of the network corresponding to the given 16-bit address asynchronously.
    `void` | `sendDataAsync(XBee64BitAddress address, byte[] data)` Sends asynchronously the provided data to the XBee device of the network corresponding to the given 64-bit address.
    `void` | `set16BitAddress(XBee16BitAddress xbee16BitAddress)` Configures the 16-bit address (network address) of this XBee device with the provided one.

    - ### Methods inherited from class com.digi.xbee.api.XBeeDevice

      `addDataListener, addIOSampleListener, addModemStatusListener, addPacketListener, close, getOperatingMode, getReceiveTimeout, isOpen, isRemote, readData, readData, readDataFrom, readDataFrom, removeDataListener, removeIOSampleListener, removeModemStatusListener, removePacketListener, reset, sendBroadcastData, sendData, sendDataAsync, sendPacket, sendPacket, sendPacketAsync, setReceiveTimeout, toString`

    - ### Methods inherited from class com.digi.xbee.api.AbstractXBeeDevice

      `applyChanges, enableApplyConfigurationChanges, executeParameter, get16BitAddress, get64BitAddress, getADCValue, getConnectionInterface, getDestinationAddress, getDIOChangeDetection, getDIOValue, getFirmwareVersion, getHardwareVersion, getIOConfiguration, getIOSamplingRate, getNodeID, getPANID, getParameter, getPowerLevel, getPWMDutyCycle, isApplyConfigurationChangesEnabled, readDeviceInfo, readIOSample, setDestinationAddress, setDIOChangeDetection, setDIOValue, setIOConfiguration, setIOSamplingRate, setNodeID, setPANID, setParameter, setPowerLevel, setPWMDutyCycle, updateDeviceDataFrom, writeChanges`

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

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

- - ### Constructor Detail

    - #### Raw802Device

          public Raw802Device(IConnectionInterface connectionInterface)

      Class constructor. Instantiates a new `Raw802Device` object with the given connection interface.
      Parameters:
        `connectionInterface` - The connection interface with the physical 802.15.4 device.
      Throws:
        `NullPointerException` - if `connectionInterface == null`
      See Also:
        `IConnectionInterface`

    - #### Raw802Device

          public Raw802Device(String port,
                      int baudRate)

      Class constructor. Instantiates a new `Raw802Device` object in the given port name and baud rate.
      Parameters:
        `port` - Serial port name where 802.15.4 device is attached to.
        `baudRate` - Serial port baud rate to communicate with the device. Other connection parameters will be set as default (8 data bits, 1 stop bit, no parity, no flow control).
      Throws:
        `IllegalArgumentException` - if `baudRate < 0`.
        `NullPointerException` - if `port == null`.

    - #### Raw802Device

          public Raw802Device(String port,
                      int baudRate,
                      int dataBits,
                      int stopBits,
                      int parity,
                      int flowControl)

      Class constructor. Instantiates a new `Raw802Device` object in the given serial port name and settings.
      Parameters:
        `port` - Serial port name where 802.15.4 device is attached to.
        `baudRate` - Serial port baud rate to communicate with the device.
        `dataBits` - Serial port data bits.
        `stopBits` - Serial port data bits.
        `parity` - Serial port data bits.
        `flowControl` - Serial port data bits.
      Throws:
        `IllegalArgumentException` - if `baudRate < 0` or if `dataBits < 0` or if `stopBits < 0` or if `parity < 0` or if `flowControl < 0`.
        `NullPointerException` - if `port == null`.

    - #### Raw802Device

          public Raw802Device(String port,
                      SerialPortParameters serialPortParameters)

      Class constructor. Instantiates a new `Raw802Device` object in the given serial port name and parameters.
      Parameters:
        `port` - Serial port name where 802.15.4 device is attached to.
        `serialPortParameters` - Object containing the serial port parameters.
      Throws:
        `NullPointerException` - if `port == null` or if `serialPortParameters == null`.
      See Also:
        `SerialPortParameters`

  - ### Method Detail

    - #### getAssociationIndicationStatus

          public AssociationIndicationStatus getAssociationIndicationStatus()
                                                                     throws TimeoutException,
                                                                            XBeeException

      Description copied from class: `AbstractXBeeDevice`
      Returns the current association status of this XBee device.

      It indicates occurrences of errors during the last association request.

      Returns:
        The association indication status of the XBee device.
      Throws:
        `TimeoutException` - if there is a timeout getting the association indication status.
        `XBeeException` - if there is any other XBee related exception.
      See Also:
        `AbstractXBeeDevice.forceDisassociate()`, `AssociationIndicationStatus`

    - #### getNetwork

          public XBeeNetwork getNetwork()

      Description copied from class: `XBeeDevice`
      Returns the network associated with this XBee device.
      Overrides:
        `getNetwork` in class `XBeeDevice`
      Returns:
        The XBee network of the device.
      See Also:
        `XBeeNetwork`

    - #### getXBeeProtocol

          public XBeeProtocol getXBeeProtocol()

      Description copied from class: `AbstractXBeeDevice`
      Returns the XBee Protocol of this XBee device.

      To refresh this value use the `AbstractXBeeDevice.readDeviceInfo()` method.

      Overrides:
        `getXBeeProtocol` in class `AbstractXBeeDevice`
      Returns:
        The XBee device protocol.
      See Also:
        `XBeeProtocol`

    - #### open

          public void open()
                    throws XBeeException

      Description copied from class: `XBeeDevice`
      Opens the connection interface associated with this XBee device.

      When opening the device an information reading process is automatically performed. This includes:

      - 64-bit address.
      - Node Identifier.
      - Hardware version.
      - Firmware version.
      - XBee device protocol.
      - 16-bit address (not for DigiMesh modules).
      Overrides:
        `open` in class `XBeeDevice`
      Throws:
        `XBeeException` - if there is any problem opening this device connection.
      See Also:
        `XBeeDevice.close()`, `XBeeDevice.isOpen()`

    - #### sendData

          public void sendData(XBee16BitAddress address,
                      byte[] data)
                        throws TimeoutException,
                               XBeeException

      Sends the provided data to the XBee device of the network corresponding to the given 16-bit address.

      This method blocks until a success or error response arrives or the configured receive timeout expires.

      The received timeout is configured using the `setReceiveTimeout` method and can be consulted with `getReceiveTimeout` method.

      For non-blocking operations use the method `sendData(XBee16BitAddress, byte[])`.

      Parameters:
        `address` - The 16-bit address of the XBee that will receive the data.
        `data` - Byte array containing data to be sent.
      Throws:
        `InterfaceNotOpenException` - if the device is not open.
        `NullPointerException` - if `address == null` or if `data == null`.
        `TimeoutException` - if there is a timeout sending the data.
        `XBeeException` - if there is any other XBee related exception.
      See Also:
        `XBee16BitAddress`, `XBeeDevice.getReceiveTimeout()`, `XBeeDevice.setReceiveTimeout(int)`, `XBeeDevice.sendData(RemoteXBeeDevice, byte[])`, `sendData(XBee64BitAddress, byte[])`, `XBeeDevice.sendDataAsync(RemoteXBeeDevice, byte[])`, `sendDataAsync(XBee16BitAddress, byte[])`, `sendDataAsync(XBee64BitAddress, byte[])`

    - #### sendData

          public void sendData(XBee64BitAddress address,
                      byte[] data)
                        throws TimeoutException,
                               XBeeException

      Description copied from class: `XBeeDevice`
      Sends the provided data to the XBee device of the network corresponding to the given 64-bit address.

      This method blocks till a success or error response arrives or the configured receive timeout expires.

      The received timeout is configured using the `setReceiveTimeout` method and can be consulted with `getReceiveTimeout` method.

      For non-blocking operations use the method `XBeeDevice.sendData(XBee64BitAddress, byte[])`.

      Parameters:
        `address` - The 64-bit address of the XBee that will receive the data.
        `data` - Byte array containing the data to be sent.
      Throws:
        `TimeoutException` - if there is a timeout sending the data.
        `XBeeException` - if there is any other XBee related exception.
      See Also:
        `XBeeDevice.getReceiveTimeout()`, `XBeeDevice.setReceiveTimeout(int)`, `XBeeDevice.sendData(RemoteXBeeDevice, byte[])`, `XBeeDevice.sendData(XBee64BitAddress, XBee16BitAddress, byte[])`, `XBeeDevice.sendDataAsync(RemoteXBeeDevice, byte[])`, `XBeeDevice.sendDataAsync(XBee64BitAddress, byte[])`, `XBeeDevice.sendDataAsync(XBee64BitAddress, XBee16BitAddress, byte[])`, `XBee64BitAddress`

    - #### sendDataAsync

          public void sendDataAsync(XBee16BitAddress address,
                           byte[] data)
                             throws XBeeException

      Sends the provided data to the XBee device of the network corresponding to the given 16-bit address asynchronously.

      Asynchronous transmissions do not wait for answer from the remote device or for transmit status packet

      Parameters:
        `address` - The 16-bit address of the XBee that will receive the data.
        `data` - Byte array containing data to be sent.
      Throws:
        `InterfaceNotOpenException` - if the device is not open.
        `NullPointerException` - if `address == null` or if `data == null`.
        `XBeeException` - if there is any XBee related exception.
      See Also:
        `XBee16BitAddress`, `XBeeDevice.sendData(RemoteXBeeDevice, byte[])`, `sendData(XBee16BitAddress, byte[])`, `sendData(XBee64BitAddress, byte[])`, `XBeeDevice.sendDataAsync(RemoteXBeeDevice, byte[])`, `sendDataAsync(XBee64BitAddress, byte[])`

    - #### sendDataAsync

          public void sendDataAsync(XBee64BitAddress address,
                           byte[] data)
                             throws XBeeException

      Description copied from class: `XBeeDevice`
      Sends asynchronously the provided data to the XBee device of the network corresponding to the given 64-bit address.

      Asynchronous transmissions do not wait for answer from the remote device or for transmit status packet.

      Parameters:
        `address` - The 64-bit address of the XBee that will receive the data.
        `data` - Byte array containing the data to be sent.
      Throws:
        `XBeeException` - if there is any XBee related exception.
      See Also:
        `XBeeDevice.sendData(RemoteXBeeDevice, byte[])`, `XBeeDevice.sendData(XBee64BitAddress, byte[])`, `XBeeDevice.sendData(XBee64BitAddress, XBee16BitAddress, byte[])`, `XBeeDevice.sendDataAsync(RemoteXBeeDevice, byte[])`, `XBeeDevice.sendDataAsync(XBee64BitAddress, XBee16BitAddress, byte[])`, `XBee64BitAddress`

    - #### set16BitAddress

          public void set16BitAddress(XBee16BitAddress xbee16BitAddress)
                               throws TimeoutException,
                                      XBeeException

      Description copied from class: `AbstractXBeeDevice`
      Configures the 16-bit address (network address) of this XBee device with the provided one.
      Parameters:
        `xbee16BitAddress` - The new 16-bit address.
      Throws:
        `TimeoutException` - if there is a timeout setting the address.
        `XBeeException` - if there is any other XBee related exception.
      See Also:
        `AbstractXBeeDevice.get16BitAddress()`, `XBee16BitAddress`

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