public class Raw802Device extends XBeeDevice
XBeeDevice
,
DigiMeshDevice
,
DigiPointDevice
,
ZigBeeDevice
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.
|
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.
|
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 Raw802Device(IConnectionInterface connectionInterface)
Raw802Device
object with the
given connection interface.connectionInterface
- The connection interface with the physical
802.15.4 device.NullPointerException
- if connectionInterface == null
IConnectionInterface
public Raw802Device(String port, int baudRate)
Raw802Device
object in the
given port name and baud rate.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).IllegalArgumentException
- if baudRate < 0
.NullPointerException
- if port == null
.public Raw802Device(String port, int baudRate, int dataBits, int stopBits, int parity, int flowControl)
Raw802Device
object in the
given serial port name and settings.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.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 Raw802Device(String port, SerialPortParameters serialPortParameters)
Raw802Device
object in the
given serial port name and parameters.port
- Serial port name where 802.15.4 device is attached to.serialPortParameters
- Object containing the serial port parameters.NullPointerException
- if port == null
or
if serialPortParameters == null
.SerialPortParameters
public AssociationIndicationStatus getAssociationIndicationStatus() throws TimeoutException, XBeeException
AbstractXBeeDevice
It 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()
,
AssociationIndicationStatus
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(XBee16BitAddress address, byte[] data) throws TimeoutException, XBeeException
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[])
.
address
- The 16-bit address of the XBee that will receive the data.data
- Byte array containing data to be sent.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.XBee16BitAddress
,
XBeeDevice.getReceiveTimeout()
,
XBeeDevice.setReceiveTimeout(int)
,
XBeeDevice.sendData(RemoteXBeeDevice, byte[])
,
sendData(XBee64BitAddress, byte[])
,
XBeeDevice.sendDataAsync(RemoteXBeeDevice, byte[])
,
sendDataAsync(XBee16BitAddress, byte[])
,
sendDataAsync(XBee64BitAddress, byte[])
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(XBee16BitAddress address, byte[] data) throws XBeeException
Asynchronous transmissions do not wait for answer from the remote device or for transmit status packet
address
- The 16-bit address of the XBee that will receive the data.data
- Byte array containing data to be sent.InterfaceNotOpenException
- if the device is not open.NullPointerException
- if address == null
or
if data == null
.XBeeException
- if there is any XBee related exception.XBee16BitAddress
,
XBeeDevice.sendData(RemoteXBeeDevice, byte[])
,
sendData(XBee16BitAddress, byte[])
,
sendData(XBee64BitAddress, byte[])
,
XBeeDevice.sendDataAsync(RemoteXBeeDevice, byte[])
,
sendDataAsync(XBee64BitAddress, byte[])
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
public void set16BitAddress(XBee16BitAddress xbee16BitAddress) throws TimeoutException, XBeeException
AbstractXBeeDevice
xbee16BitAddress
- The new 16-bit address.TimeoutException
- if there is a timeout setting the address.XBeeException
- if there is any other XBee related exception.AbstractXBeeDevice.get16BitAddress()
,
XBee16BitAddress
© Copyright 2014–2014 Digi International Inc. All rights reserved.