public class ZigBeeDevice extends XBeeDevice
XBeeDevice,
DigiMeshDevice,
DigiPointDevice,
Raw802Device| Constructor and Description |
|---|
ZigBeeDevice(IConnectionInterface connectionInterface)
Class constructor.
|
ZigBeeDevice(String port,
int baudRate)
Class constructor.
|
ZigBeeDevice(String port,
int baudRate,
int dataBits,
int stopBits,
int parity,
int flowControl)
Class constructor.
|
ZigBeeDevice(String port,
SerialPortParameters serialPortParameters)
Class constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
forceDisassociate()
Forces this XBee device to immediately disassociate from the network and
re-attempt to associate.
|
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(XBee64BitAddress address64Bit,
XBee16BitAddress address16bit,
byte[] data)
Sends the provided data to the XBee device of the network corresponding
to the given 64-bit/16-bit address.
|
void |
sendDataAsync(XBee64BitAddress address64Bit,
XBee16BitAddress address16bit,
byte[] data)
Sends asynchronously the provided data to the XBee device of the network
corresponding to the given 64-bit/16-bit address.
|
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, toStringapplyChanges, 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, writeChangespublic ZigBeeDevice(IConnectionInterface connectionInterface)
ZigBeeDevice object with the
given connection interface.connectionInterface - The connection interface with the physical
ZigBee device.NullPointerException - if connectionInterface == nullIConnectionInterfacepublic ZigBeeDevice(String port, int baudRate)
ZigBeeDevice object in the
given port name and baud rate.port - Serial port name where ZigBee 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).IllegalArgumentException - if baudRate < 0.NullPointerException - if port == null.public ZigBeeDevice(String port, int baudRate, int dataBits, int stopBits, int parity, int flowControl)
ZigBeeDevice object in the
given serial port name and settings.port - Serial port name where ZigBee 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.IllegalArgumentException - if baudRate < 0 or
if dataBits < 0 or
if stopBits < 0 or
if parity < 0 or
if flowControl < 0.NullPointerException - if port == null.public ZigBeeDevice(String port, SerialPortParameters serialPortParameters)
ZigBeeDevice object in the
given serial port name and parameters.port - Serial port name where ZigBee device is attached to.serialPortParameters - Object containing the serial port parameters.NullPointerException - if port == null or
if serialPortParameters == null.SerialPortParameterspublic void forceDisassociate() throws TimeoutException, XBeeException
AbstractXBeeDeviceOnly valid for End Devices.
TimeoutException - if there is a timeout executing the
disassociation command.XBeeException - if there is any other XBee related exception.AbstractXBeeDevice.getAssociationIndicationStatus()public AssociationIndicationStatus getAssociationIndicationStatus() throws TimeoutException, XBeeException
AbstractXBeeDeviceIt indicates occurrences of errors during the last association request.
TimeoutException - if there is a timeout getting the association
indication status.XBeeException - if there is any other XBee related exception.AbstractXBeeDevice.forceDisassociate(),
AssociationIndicationStatuspublic XBeeNetwork getNetwork()
XBeeDevicegetNetwork in class XBeeDeviceXBeeNetworkpublic XBeeProtocol getXBeeProtocol()
AbstractXBeeDeviceTo refresh this value use the AbstractXBeeDevice.readDeviceInfo() method.
getXBeeProtocol in class AbstractXBeeDeviceXBeeProtocolpublic void open() throws XBeeException
XBeeDeviceWhen opening the device an information reading process is automatically performed. This includes:
open in class XBeeDeviceXBeeException - if there is any problem opening this device
connection.XBeeDevice.close(),
XBeeDevice.isOpen()public void sendData(XBee64BitAddress address64Bit, XBee16BitAddress address16bit, byte[] data) throws TimeoutException, XBeeException
XBeeDeviceThis 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.sendDataAsync(XBee64BitAddress, XBee16BitAddress, byte[]).
address64Bit - The 64-bit address of the XBee that will receive the
data.address16bit - The 16-bit address of the XBee that will receive the
data. If it is unknown the
XBee16BitAddress.UNKNOWN_ADDRESS must be
used.data - Byte array containing the data to be sent.TimeoutException - if there is a timeout sending the data.XBeeException - if a remote device is trying to send data or
if there is any other XBee related exception.XBeeDevice.getReceiveTimeout(),
XBeeDevice.setReceiveTimeout(int),
XBeeDevice.sendData(RemoteXBeeDevice, byte[]),
XBeeDevice.sendData(XBee64BitAddress, byte[]),
XBeeDevice.sendDataAsync(RemoteXBeeDevice, byte[]),
XBeeDevice.sendDataAsync(XBee64BitAddress, byte[]),
XBeeDevice.sendDataAsync(XBee64BitAddress, XBee16BitAddress, byte[]),
XBee16BitAddress,
XBee64BitAddresspublic void sendDataAsync(XBee64BitAddress address64Bit, XBee16BitAddress address16bit, byte[] data) throws XBeeException
XBeeDeviceAsynchronous transmissions do not wait for answer from the remote device or for transmit status packet.
address64Bit - The 64-bit address of the XBee that will receive the
data.address16bit - The 16-bit address of the XBee that will receive the
data. If it is unknown the
XBee16BitAddress.UNKNOWN_ADDRESS must be
used.data - Byte array containing the data to be sent.XBeeException - if a remote device is trying to send data or
if there is any other XBee related exception.XBeeDevice.getReceiveTimeout(),
XBeeDevice.setReceiveTimeout(int),
XBeeDevice.sendData(RemoteXBeeDevice, byte[]),
XBeeDevice.sendData(XBee64BitAddress, byte[]),
XBeeDevice.sendData(XBee64BitAddress, XBee16BitAddress, byte[]),
XBeeDevice.sendDataAsync(RemoteXBeeDevice, byte[]),
XBeeDevice.sendDataAsync(XBee64BitAddress, byte[]),
XBee16BitAddress,
XBee64BitAddress© Copyright 2014–2014 Digi International Inc. All rights reserved.