public class DigiMeshDevice extends XBeeDevice
XBeeDevice,
DigiPointDevice,
Raw802Device,
ZigBeeDevice| Constructor and Description |
|---|
DigiMeshDevice(IConnectionInterface connectionInterface)
Class constructor.
|
DigiMeshDevice(String port,
int baudRate)
Class constructor.
|
DigiMeshDevice(String port,
int baudRate,
int dataBits,
int stopBits,
int parity,
int flowControl)
Class constructor.
|
DigiMeshDevice(String port,
SerialPortParameters serialPortParameters)
Class constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addExplicitDataListener(IExplicitDataReceiveListener listener)
Adds the provided listener to the list of listeners to be notified
when new explicit data packets are received.
|
APIOutputMode |
getAPIOutputMode()
Returns the API output mode of the 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.
|
ExplicitXBeeMessage |
readExplicitData()
Reads new explicit data received by this XBee device during the
configured receive timeout.
|
ExplicitXBeeMessage |
readExplicitData(int timeout)
Reads new explicit data received by this XBee device during the provided
timeout.
|
ExplicitXBeeMessage |
readExplicitDataFrom(RemoteXBeeDevice remoteXBeeDevice)
Reads new explicit data received from the given remote XBee device
during the configured receive timeout.
|
ExplicitXBeeMessage |
readExplicitDataFrom(RemoteXBeeDevice remoteXBeeDevice,
int timeout)
Reads new explicit data received from the given remote XBee device
during the provided timeout.
|
void |
removeExplicitDataListener(IExplicitDataReceiveListener listener)
Removes the provided listener from the list of explicit data receive
listeners.
|
void |
sendBroadcastExplicitData(int sourceEndpoint,
int destEndpoint,
int clusterID,
int profileID,
byte[] data)
Sends the provided data to all the XBee nodes of the network (broadcast)
in application layer mode.
|
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(XBee64BitAddress address,
byte[] data)
Sends asynchronously the provided data to the XBee device of the network
corresponding to the given 64-bit address.
|
void |
sendExplicitData(RemoteXBeeDevice remoteXBeeDevice,
int sourceEndpoint,
int destEndpoint,
int clusterID,
int profileID,
byte[] data)
Sends the provided data to the given XBee device in application layer
mode choosing the optimal send method depending on the protocol of the
local XBee device.
|
void |
sendExplicitData(XBee64BitAddress address,
int sourceEndpoint,
int destEndpoint,
int clusterID,
int profileID,
byte[] data)
Sends the provided data in application layer mode to the XBee device of
the network corresponding to the given 64-bit address.
|
void |
sendExplicitDataAsync(RemoteXBeeDevice xbeeDevice,
int sourceEndpoint,
int destEndpoint,
int clusterID,
int profileID,
byte[] data)
Sends asynchronously the provided data in application layer mode to the
provided XBee device choosing the optimal send method depending on the
protocol of the local XBee device.
|
void |
sendExplicitDataAsync(XBee64BitAddress address,
int sourceEndpoint,
int destEndpoint,
int clusterID,
int profileID,
byte[] data)
Sends asynchronously the provided data in application layer mode to the
XBee device of the network corresponding to the given 64-bit address.
|
void |
setAPIOutputMode(APIOutputMode apiOutputMode)
Configures the API output mode of the XBee device.
|
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 DigiMeshDevice(IConnectionInterface connectionInterface)
DigiMeshDevice object with the
given connection interface.connectionInterface - The connection interface with the physical
DigiMesh device.NullPointerException - if connectionInterface == nullIConnectionInterfacepublic DigiMeshDevice(String port, int baudRate)
DigiMeshDevice object in the
given port name and baud rate.port - Serial port name where DigiMesh 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 DigiMeshDevice(String port, int baudRate, int dataBits, int stopBits, int parity, int flowControl)
DigiMeshDevice object in the
given serial port name and settings.port - Serial port name where DigiMesh 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 DigiMeshDevice(String port, SerialPortParameters serialPortParameters)
DigiMeshDevice object in the
given serial port name and parameters.port - Serial port name where DigiMesh device is attached to.serialPortParameters - Object containing the serial port parameters.NullPointerException - if port == null or
if serialPortParameters == null.SerialPortParameterspublic void addExplicitDataListener(IExplicitDataReceiveListener listener)
AbstractXBeeDeviceIf the listener has been already included this method does nothing.
listener - Listener to be notified when new explicit data packets
are received.AbstractXBeeDevice.removeExplicitDataListener(IExplicitDataReceiveListener),
IExplicitDataReceiveListenerpublic APIOutputMode getAPIOutputMode() throws TimeoutException, XBeeException
XBeeDeviceThe API output mode determines the format that the received data is output through the serial interface of the XBee device.
TimeoutException - if there is a timeout getting the API output
mode from the device.XBeeException - if there is any other XBee related exception.XBeeDevice.setAPIOutputMode(APIOutputMode),
APIOutputModepublic 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 ExplicitXBeeMessage readExplicitData()
XBeeDeviceThis method blocks until new explicit data is received or the configured receive timeout expires.
The receive timeout is configured using the setReceiveTimeout
method and can be consulted with getReceiveTimeout method.
For non-blocking operations, register a
IExplicitDataReceiveListener using the method
AbstractXBeeDevice.addExplicitDataListener(IExplicitDataReceiveListener).
ExplicitXBeeMessage object containing the explicit
data, the source address of the remote node that sent the data
and other values related to the transmission. null if
this did not receive new explicit data during the configured
receive timeout.XBeeDevice.getReceiveTimeout(),
XBeeDevice.readExplicitData(int),
XBeeDevice.readExplicitDataFrom(RemoteXBeeDevice),
XBeeDevice.readExplicitDataFrom(RemoteXBeeDevice, int),
XBeeDevice.setReceiveTimeout(int),
ExplicitXBeeMessagepublic ExplicitXBeeMessage readExplicitData(int timeout)
XBeeDeviceThis method blocks until new explicit data is received or the provided timeout expires.
For non-blocking operations, register a
IExplicitDataReceiveListener using the method
AbstractXBeeDevice.addExplicitDataListener(IExplicitDataReceiveListener).
timeout - The time to wait for new explicit data in milliseconds.ExplicitXBeeMessage object containing the explicit
data, the source address of the remote node that sent the data
and other values related to the transmission. null if
this device did not receive new explicit data during
timeout milliseconds.XBeeDevice.readExplicitData(),
XBeeDevice.readExplicitDataFrom(RemoteXBeeDevice),
XBeeDevice.readExplicitDataFrom(RemoteXBeeDevice, int),
ExplicitXBeeMessagepublic ExplicitXBeeMessage readExplicitDataFrom(RemoteXBeeDevice remoteXBeeDevice)
XBeeDeviceThis method blocks until new explicit data from the provided remote XBee device is received or the configured receive timeout expires.
The receive timeout is configured using the setReceiveTimeout
method and can be consulted with getReceiveTimeout method.
For non-blocking operations, register a
IExplicitDataReceiveListener using the method
AbstractXBeeDevice.addExplicitDataListener(IExplicitDataReceiveListener).
remoteXBeeDevice - The remote device to read explicit data from.ExplicitXBeeMessage object containing the explicit
data, the source address of the remote node that sent the data
and other values related to the transmission. null if
this device did not receive new explicit data from the provided
remote XBee device during the configured receive timeout.XBeeDevice.getReceiveTimeout(),
XBeeDevice.readExplicitData(),
XBeeDevice.readExplicitData(int),
XBeeDevice.readExplicitDataFrom(RemoteXBeeDevice, int),
XBeeDevice.setReceiveTimeout(int),
RemoteXBeeDevice,
ExplicitXBeeMessagepublic ExplicitXBeeMessage readExplicitDataFrom(RemoteXBeeDevice remoteXBeeDevice, int timeout)
XBeeDeviceThis method blocks until new explicit data from the provided remote XBee device is received or the given timeout expires.
For non-blocking operations, register a
IExplicitDataReceiveListener using the method
AbstractXBeeDevice.addExplicitDataListener(IExplicitDataReceiveListener).
remoteXBeeDevice - The remote device to read explicit data from.timeout - The time to wait for new explicit data in milliseconds.ExplicitXBeeMessage object containing the explicit
data, the source address of the remote node that sent the data
and other values related to the transmission. null if
this device did not receive new data from the provided remote
XBee device during timeout milliseconds.XBeeDevice.getReceiveTimeout(),
XBeeDevice.readExplicitData(),
XBeeDevice.readExplicitData(int),
XBeeDevice.readExplicitDataFrom(RemoteXBeeDevice),
XBeeDevice.setReceiveTimeout(int),
RemoteXBeeDevice,
ExplicitXBeeMessagepublic void removeExplicitDataListener(IExplicitDataReceiveListener listener)
AbstractXBeeDeviceIf the listener was not in the list this method does nothing.
listener - Listener to be removed from the list of listeners.AbstractXBeeDevice.addExplicitDataListener(IExplicitDataReceiveListener),
IExplicitDataReceiveListenerpublic void sendBroadcastExplicitData(int sourceEndpoint, int destEndpoint, int clusterID, int profileID, byte[] data) throws TimeoutException, XBeeException
XBeeDeviceThis method blocks till a success or error transmit status arrives or the configured receive timeout expires.
The receive timeout is configured using the setReceiveTimeout
method and can be consulted with getReceiveTimeout method.
sourceEndpoint - Source endpoint for the transmission.destEndpoint - Destination endpoint for the transmission.clusterID - Cluster ID used in the transmission.profileID - Profile ID used in the transmission.data - Byte array containing the data to be sent.TimeoutException - if there is a timeout sending the data.XBeeException - if there is any other XBee related exception.XBeeDevice.getReceiveTimeout(),
XBeeDevice.setReceiveTimeout(int)public void sendData(XBee64BitAddress address, byte[] data) throws TimeoutException, XBeeException
XBeeDeviceThis method blocks till a success or error response arrives or the configured receive timeout expires.
The receive timeout is configured using the setReceiveTimeout
method and can be consulted with getReceiveTimeout method.
For non-blocking operations use the method
XBeeDevice.sendDataAsync(XBee64BitAddress, byte[]).
address - The 64-bit address of the XBee that will receive the data.data - Byte array containing the data to be sent.TimeoutException - if there is a timeout sending the data.XBeeException - if there is any other XBee related exception.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[]),
XBee64BitAddresspublic void sendDataAsync(XBee64BitAddress address, byte[] data) throws XBeeException
XBeeDeviceAsynchronous transmissions do not wait for answer from the remote device or for transmit status packet.
address - The 64-bit address of the XBee that will receive the data.data - Byte array containing the data to be sent.XBeeException - if there is any XBee related exception.XBeeDevice.sendData(RemoteXBeeDevice, byte[]),
XBeeDevice.sendData(XBee64BitAddress, byte[]),
XBeeDevice.sendData(XBee64BitAddress, XBee16BitAddress, byte[]),
XBeeDevice.sendDataAsync(RemoteXBeeDevice, byte[]),
XBeeDevice.sendDataAsync(XBee64BitAddress, XBee16BitAddress, byte[]),
XBee64BitAddresspublic void sendExplicitData(RemoteXBeeDevice remoteXBeeDevice, int sourceEndpoint, int destEndpoint, int clusterID, int profileID, byte[] data) throws TimeoutException, XBeeException
XBeeDeviceThis method blocks till a success or error response arrives or the configured receive timeout expires.
The receive timeout is configured using the setReceiveTimeout
method and can be consulted with getReceiveTimeout method.
remoteXBeeDevice - The XBee device of the network that will receive
the explicit data.sourceEndpoint - Source endpoint for the transmission.destEndpoint - Destination endpoint for the transmission.clusterID - Cluster ID used in the transmission.profileID - Profile ID used in the transmission.data - Byte array containing the data to be sent.TimeoutException - if there is a timeout sending the data.XBeeException - if there is any other XBee related exception.XBeeDevice.getReceiveTimeout(),
XBeeDevice.sendExplicitData(XBee64BitAddress, int, int, int, int, byte[]),
XBeeDevice.sendExplicitData(XBee64BitAddress, XBee16BitAddress, int, int, int, int, byte[]),
XBeeDevice.setReceiveTimeout(int),
RemoteXBeeDevicepublic void sendExplicitData(XBee64BitAddress address, int sourceEndpoint, int destEndpoint, int clusterID, int profileID, byte[] data) throws TimeoutException, XBeeException
XBeeDeviceThis method blocks till a success or error response arrives or the configured receive timeout expires.
The receive timeout is configured using the setReceiveTimeout
method and can be consulted with getReceiveTimeout method.
address - The 64-bit address of the XBee that will receive the data.sourceEndpoint - Source endpoint for the transmission.destEndpoint - Destination endpoint for the transmission.clusterID - Cluster ID used in the transmission.profileID - Profile ID used in the transmission.data - Byte array containing the data to be sent.TimeoutException - if there is a timeout sending the data.XBeeException - if there is any other XBee related exception.XBeeDevice.getReceiveTimeout(),
XBeeDevice.sendExplicitData(RemoteXBeeDevice, int, int, int, int, byte[]),
XBeeDevice.sendExplicitData(XBee64BitAddress, XBee16BitAddress, int, int, int, int, byte[]),
XBeeDevice.setReceiveTimeout(int),
XBee64BitAddresspublic void sendExplicitDataAsync(RemoteXBeeDevice xbeeDevice, int sourceEndpoint, int destEndpoint, int clusterID, int profileID, byte[] data) throws XBeeException
XBeeDeviceAsynchronous transmissions do not wait for answer from the remote device or for transmit status packet.
xbeeDevice - The XBee device of the network that will receive
the data.sourceEndpoint - Source endpoint for the transmission.destEndpoint - Destination endpoint for the transmission.clusterID - Cluster ID used in the transmission.profileID - Profile ID used in the transmission.data - Byte array containing the data to be sent.XBeeException - if there is any other XBee related exception.XBeeDevice.sendExplicitData(RemoteXBeeDevice, int, int, int, int, byte[]),
XBeeDevice.sendExplicitData(XBee64BitAddress, int, int, int, int, byte[]),
XBeeDevice.sendExplicitData(XBee64BitAddress, XBee16BitAddress, int, int, int, int, byte[]),
XBeeDevice.sendExplicitDataAsync(XBee64BitAddress, int, int, int, int, byte[]),
XBeeDevice.sendExplicitDataAsync(XBee64BitAddress, XBee16BitAddress, int, int, int, int, byte[]),
RemoteXBeeDevicepublic void sendExplicitDataAsync(XBee64BitAddress address, int sourceEndpoint, int destEndpoint, int clusterID, int profileID, byte[] data) throws XBeeException
XBeeDeviceAsynchronous transmissions do not wait for answer from the remote device or for transmit status packet.
address - The 64-bit address of the XBee that will receive the data.sourceEndpoint - Source endpoint for the transmission.destEndpoint - Destination endpoint for the transmission.clusterID - Cluster ID used in the transmission.profileID - Profile ID used in the transmission.data - Byte array containing the data to be sent.XBeeException - if there is any other XBee related exception.XBeeDevice.sendExplicitData(RemoteXBeeDevice, int, int, int, int, byte[]),
XBeeDevice.sendExplicitData(XBee64BitAddress, int, int, int, int, byte[]),
XBeeDevice.sendExplicitData(XBee64BitAddress, XBee16BitAddress, int, int, int, int, byte[]),
XBeeDevice.sendExplicitDataAsync(RemoteXBeeDevice, int, int, int, int, byte[]),
XBeeDevice.sendExplicitDataAsync(XBee64BitAddress, XBee16BitAddress, int, int, int, int, byte[]),
XBee64BitAddresspublic void setAPIOutputMode(APIOutputMode apiOutputMode) throws TimeoutException, XBeeException
XBeeDeviceThe API output mode determines the format that the received data is output through the serial interface of the XBee device.
apiOutputMode - The API output mode to be set to the XBee device.TimeoutException - if there is a timeout configuring the API
output mode.XBeeException - if there is any other XBee related exception.XBeeDevice.getAPIOutputMode(),
APIOutputMode© Copyright 2014?2015 Digi International Inc. All rights reserved.