public class ThreadDevice extends IPv6Device
CellularDevice
,
DigiPointDevice
,
DigiMeshDevice
,
Raw802Device
,
WiFiDevice
,
XBeeDevice
,
ZigBeeDevice
Constructor and Description |
---|
ThreadDevice(IConnectionInterface connectionInterface)
Class constructor.
|
ThreadDevice(String port,
int baudRate)
Class constructor.
|
ThreadDevice(String port,
int baudRate,
int dataBits,
int stopBits,
int parity,
int flowControl)
Class constructor.
|
ThreadDevice(String port,
SerialPortParameters serialPortParameters)
Class constructor.
|
Modifier and Type | Method and Description |
---|---|
ThreadAssociationIndicationStatus |
getThreadAssociationIndicationStatus()
Returns the current association status of this Thread device.
|
XBeeProtocol |
getXBeeProtocol()
Returns the XBee Protocol of this XBee device.
|
boolean |
isConnected()
Returns whether the device is associated to a network or not.
|
void |
open()
Opens the connection interface associated with this XBee device.
|
byte[] |
sendCoAPData(Inet6Address ipv6Address,
String uri,
HTTPMethodEnum method,
boolean applyChanges,
byte[] data)
Sends the provided CoAP IPv6 data to the given IPv6 address and port using
the specified IPv6 protocol.
|
byte[] |
sendCoAPData(Inet6Address ipv6Address,
String uri,
HTTPMethodEnum method,
byte[] data)
Sends the provided CoAP IPv6 data to the given IPv6 address and port using
the specified IPv6 protocol.
|
void |
sendCoAPDataAsync(Inet6Address ipv6Address,
String uri,
HTTPMethodEnum method,
boolean applyChanges,
byte[] data)
Sends the provided CoAP IPv6 data to the given IPv6 address and port
asynchronously using the specified IPv6 protocol.
|
void |
sendCoAPDataAsync(Inet6Address ipv6Address,
String uri,
HTTPMethodEnum method,
byte[] data)
Sends the provided CoAP IPv6 data to the given IPv6 address and port
asynchronously using the specified IPv6 protocol.
|
void |
sendIPData(Inet6Address ipv6Address,
int destPort,
IPProtocol protocol,
byte[] data)
Sends the provided IPv6 data to the given IPv6 address and port using
the specified IPv6 protocol.
|
void |
sendIPDataAsync(Inet6Address ipv6Address,
int destPort,
IPProtocol protocol,
byte[] data)
Sends the provided IPv6 data to the given IPv6 address and port
asynchronously using the specified IPv6 protocol.
|
addIPDataListener, readDeviceInfo, readIPData, readIPData, readIPDataFrom, readIPDataFrom, removeIPDataListener, startListening, stopListening
addBluetoothDataListener, addDataListener, addIOSampleListener, addMicroPythonDataListener, addModemStatusListener, addPacketListener, addUserDataRelayListener, close, getNetwork, getNextFrameID, getOperatingMode, getReceiveTimeout, isOpen, isRemote, readData, readData, readDataFrom, readDataFrom, readPacket, readPacket, readPacketFrom, readPacketFrom, removeBluetoothDataListener, removeDataListener, removeIOSampleListener, removeMicroPythonDataListener, removeModemStatusListener, removePacketListener, removeUserDataRelayListener, reset, sendBluetoothData, sendBroadcastData, sendData, sendDataAsync, sendMicroPythonData, sendPacket, sendPacket, sendPacketAsync, sendUserDataRelay, setReceiveTimeout, toString
applyChanges, disableBluetooth, enableApplyConfigurationChanges, enableBluetooth, executeParameter, get16BitAddress, get64BitAddress, getADCValue, getBluetoothMacAddress, getConnectionInterface, getDestinationAddress, getDIOChangeDetection, getDIOValue, getFirmwareVersion, getHardwareVersion, getIOConfiguration, getIOSamplingRate, getIPv6Address, getIPv6DestinationAddress, getNodeID, getPANID, getParameter, getPowerLevel, getPWMDutyCycle, isApplyConfigurationChangesEnabled, readIOSample, setDestinationAddress, setDIOChangeDetection, setDIOValue, setIOConfiguration, setIOSamplingRate, setIPv6DestinationAddress, setNodeID, setPANID, setParameter, setPowerLevel, setPWMDutyCycle, updateBluetoothPassword, updateDeviceDataFrom, writeChanges
public ThreadDevice(IConnectionInterface connectionInterface)
ThreadDevice
object with
the given connection interface.connectionInterface
- The connection interface with the physical
Thread device.NullPointerException
- if connectionInterface == null
ThreadDevice(String, int)
,
ThreadDevice(String, SerialPortParameters)
,
ThreadDevice(String, int, int, int, int, int)
,
IConnectionInterface
public ThreadDevice(String port, int baudRate)
ThreadDevice
object in
the given port name and baud rate.port
- Serial port name where Thread 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
.ThreadDevice(IConnectionInterface)
,
ThreadDevice(String, SerialPortParameters)
,
ThreadDevice(String, int, int, int, int, int)
public ThreadDevice(String port, int baudRate, int dataBits, int stopBits, int parity, int flowControl)
ThreadDevice
object in
the given serial port name and settings.port
- Serial port name where Thread 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
.ThreadDevice(IConnectionInterface)
,
ThreadDevice(String, int)
,
ThreadDevice(String, SerialPortParameters)
public ThreadDevice(String port, SerialPortParameters serialPortParameters)
ThreadDevice
object in
the given serial port name and parameters.port
- Serial port name where Thread device is attached to.serialPortParameters
- Object containing the serial port parameters.NullPointerException
- if port == null
or
if serialPortParameters == null
.ThreadDevice(IConnectionInterface)
,
ThreadDevice(String, int)
,
ThreadDevice(String, int, int, int, int, int)
,
SerialPortParameters
public ThreadAssociationIndicationStatus getThreadAssociationIndicationStatus() throws TimeoutException, XBeeException
InterfaceNotOpenException
- if this device connection is not open.TimeoutException
- if there is a timeout getting the association
indication status.XBeeException
- if there is any other XBee related exception.ThreadAssociationIndicationStatus
public XBeeProtocol getXBeeProtocol()
AbstractXBeeDevice
To refresh this value use the AbstractXBeeDevice.readDeviceInfo()
method.
getXBeeProtocol
in class AbstractXBeeDevice
XBeeProtocol
public boolean isConnected() throws TimeoutException, XBeeException
true
if the device is connected to a network,
false
otherwise.InterfaceNotOpenException
- if this device connection is not open.TimeoutException
- if there is a timeout getting the association
indication status.XBeeException
- if there is any other XBee related exception.getThreadAssociationIndicationStatus()
,
ThreadAssociationIndicationStatus
public void open() throws XBeeException
AbstractXBeeDevice
When opening the device an information reading process is automatically performed. This includes:
open
in class XBeeDevice
BluetoothAuthenticationException
- if there is any problem in the
Bluetooth authentication.XBeeException
- if there is any problem opening this device
connection.AbstractXBeeDevice.close()
,
AbstractXBeeDevice.isOpen()
public byte[] sendCoAPData(Inet6Address ipv6Address, String uri, HTTPMethodEnum method, boolean applyChanges, byte[] data) throws TimeoutException, IllegalArgumentException, XBeeException
This 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
sendCoAPDataAsync(Inet6Address, String, HTTPMethodEnum,
boolean, byte[])
.
ipv6Address
- The IPv6 address to send CoAP IPv6 data to.uri
- Uniform Resource Identifier. Every CoAP message must have a
valid URI string and must meet the following criteria. There
are built-in CoAP URIs:
method
- HTTP method used for the transmission.applyChanges
- true
to apply the changes after sending the
packet, false
otherwise.data
- Byte array containing the CoAP IPv6 data to be sent.null
.IllegalArgumentException
- if uri
starts with "XB/AT" and
its length is lesser than 8 (XB/AT/XX).InterfaceNotOpenException
- if this device connection is not open.NullPointerException
- if ipv6Address == null
or
if uri == null
or
if method == null
.TimeoutException
- if there is a timeout sending the data.XBeeException
- if there is any other XBee related exception.XBeeDevice.getReceiveTimeout()
,
sendCoAPData(Inet6Address, String, HTTPMethodEnum, byte[])
,
sendCoAPDataAsync(Inet6Address, String, HTTPMethodEnum, byte[])
,
sendCoAPDataAsync(Inet6Address, String, HTTPMethodEnum, boolean, byte[])
,
XBeeDevice.setReceiveTimeout(int)
,
HTTPMethodEnum
,
Inet6Address
public byte[] sendCoAPData(Inet6Address ipv6Address, String uri, HTTPMethodEnum method, byte[] data) throws TimeoutException, IllegalArgumentException, XBeeException
This 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
sendCoAPDataAsync(Inet6Address, String, HTTPMethodEnum, byte[])
.
ipv6Address
- The IPv6 address to send CoAP IPv6 data to.uri
- Uniform Resource Identifier. Every CoAP message must have a
valid URI string and must meet the following criteria. There
are built-in CoAP URIs:
method
- HTTP method used for the transmission.data
- Byte array containing the CoAP IPv6 data to be sent.null
.IllegalArgumentException
- if uri
starts with "XB/AT" and
its length is lesser than 8 (XB/AT/XX).InterfaceNotOpenException
- if this device connection is not open.NullPointerException
- if ipv6Address == null
or
if uri == null
or
if method == null
.TimeoutException
- if there is a timeout sending the data.XBeeException
- if there is any other XBee related exception.XBeeDevice.getReceiveTimeout()
,
sendCoAPData(Inet6Address, String, HTTPMethodEnum, boolean, byte[])
,
sendCoAPDataAsync(Inet6Address, String, HTTPMethodEnum, byte[])
,
sendCoAPDataAsync(Inet6Address, String, HTTPMethodEnum, boolean, byte[])
,
XBeeDevice.setReceiveTimeout(int)
,
HTTPMethodEnum
,
Inet6Address
public void sendCoAPDataAsync(Inet6Address ipv6Address, String uri, HTTPMethodEnum method, boolean applyChanges, byte[] data) throws TimeoutException, IllegalArgumentException, XBeeException
Asynchronous transmissions do not wait for answer from the remote device or for transmit status packet.
For blocking operations use the method
sendCoAPData(Inet6Address, String, HTTPMethodEnum, boolean, byte[])
.
ipv6Address
- The IPv6 address to send CoAP IPv6 data to.uri
- Uniform Resource Identifier. Every CoAP message must have a
valid URI string and must meet the following criteria. There
are built-in CoAP URIs:
method
- HTTP method used for the transmission.applyChanges
- true
to apply the changes after sending the
packet, false
otherwise.data
- Byte array containing the CoAP IPv6 data to be sent.IllegalArgumentException
- if uri
starts with "XB/AT" and
its length is lesser than 8 (XB/AT/XX).InterfaceNotOpenException
- if this device connection is not open.NullPointerException
- if ipv6Address == null
or
if uri == null
or
if method == null
.TimeoutException
- if there is a timeout sending the data.XBeeException
- if there is any other XBee related exception.XBeeDevice.getReceiveTimeout()
,
sendCoAPData(Inet6Address, String, HTTPMethodEnum, byte[])
,
sendCoAPData(Inet6Address, String, HTTPMethodEnum, boolean, byte[])
,
sendCoAPDataAsync(Inet6Address, String, HTTPMethodEnum, byte[])
,
XBeeDevice.setReceiveTimeout(int)
,
HTTPMethodEnum
,
Inet6Address
public void sendCoAPDataAsync(Inet6Address ipv6Address, String uri, HTTPMethodEnum method, byte[] data) throws TimeoutException, IllegalArgumentException, XBeeException
Asynchronous transmissions do not wait for answer from the remote device or for transmit status packet.
For blocking operations use the method
sendCoAPData(Inet6Address, String, HTTPMethodEnum, byte[])
.
ipv6Address
- The IPv6 address to send CoAP IPv6 data to.uri
- Uniform Resource Identifier. Every CoAP message must have a
valid URI string and must meet the following criteria. There
are built-in CoAP URIs:
method
- HTTP method used for the transmission.data
- Byte array containing the CoAP IPv6 data to be sent.IllegalArgumentException
- if uri
starts with "XB/AT" and
its length is lesser than 8 (XB/AT/XX).InterfaceNotOpenException
- if this device connection is not open.NullPointerException
- if ipv6Address == null
or
if uri == null
or
if method == null
.TimeoutException
- if there is a timeout sending the data.XBeeException
- if there is any other XBee related exception.XBeeDevice.getReceiveTimeout()
,
sendCoAPData(Inet6Address, String, HTTPMethodEnum, byte[])
,
sendCoAPData(Inet6Address, String, HTTPMethodEnum, boolean, byte[])
,
sendCoAPDataAsync(Inet6Address, String, HTTPMethodEnum, boolean, byte[])
,
XBeeDevice.setReceiveTimeout(int)
,
HTTPMethodEnum
,
Inet6Address
public void sendIPData(Inet6Address ipv6Address, int destPort, IPProtocol protocol, byte[] data) throws TimeoutException, XBeeException
IPv6Device
This 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
IPv6Device.sendIPDataAsync(Inet6Address, int, IPProtocol, byte[])
.
sendIPData
in class IPv6Device
ipv6Address
- The IPv6 address to send IPv6 data to.destPort
- The destination port of the transmission.protocol
- The IPv6 protocol used for the transmission.data
- Byte array containing the IPv6 data to be sent.TimeoutException
- if there is a timeout sending the data.XBeeException
- if there is any other XBee related exception.XBeeDevice.getReceiveTimeout()
,
IPv6Device.sendIPDataAsync(Inet6Address, int, IPProtocol, byte[])
,
XBeeDevice.setReceiveTimeout(int)
,
IPProtocol
,
Inet6Address
public void sendIPDataAsync(Inet6Address ipv6Address, int destPort, IPProtocol protocol, byte[] data) throws XBeeException
IPv6Device
Asynchronous transmissions do not wait for answer from the remote device or for transmit status packet.
sendIPDataAsync
in class IPv6Device
ipv6Address
- The IPv6 address to send IPv6 data to.destPort
- The destination port of the transmission.protocol
- The IPv6 protocol used for the transmission.data
- Byte array containing the IPv6 data to be sent.TimeoutException
- if there is a timeout sending the data.XBeeException
- if there is any other XBee related exception.IPv6Device.sendIPData(Inet6Address, int, IPProtocol, byte[])
,
IPProtocol
,
Inet6Address
© Copyright 2014 - 2024 Digi International Inc. All rights reserved.