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 |
---|---|
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 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.
|
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
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
public DigiMeshDevice(IConnectionInterface connectionInterface)
DigiMeshDevice
object with the
given connection interface.connectionInterface
- The connection interface with the physical
DigiMesh device.NullPointerException
- if connectionInterface == null
IConnectionInterface
public 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
.SerialPortParameters
public XBeeNetwork getNetwork()
XBeeDevice
getNetwork
in class XBeeDevice
XBeeNetwork
public XBeeProtocol getXBeeProtocol()
AbstractXBeeDevice
To refresh this value use the AbstractXBeeDevice.readDeviceInfo()
method.
getXBeeProtocol
in class AbstractXBeeDevice
XBeeProtocol
public void open() throws XBeeException
XBeeDevice
When opening the device an information reading process is automatically performed. This includes:
open
in class XBeeDevice
XBeeException
- if there is any problem opening this device
connection.XBeeDevice.close()
,
XBeeDevice.isOpen()
public void sendData(XBee64BitAddress address, byte[] data) throws TimeoutException, XBeeException
XBeeDevice
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[])
.
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[])
,
XBee64BitAddress
public void sendDataAsync(XBee64BitAddress address, byte[] data) throws XBeeException
XBeeDevice
Asynchronous 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[])
,
XBee64BitAddress
© Copyright 2014–2014 Digi International Inc. All rights reserved.