Class AbstractXBeeDevice
This class provides common functionality for all XBee devices.
Inherited Members
Namespace: XBeeLibrary.Core
Assembly: XBeeLibrary.Core.dll
Syntax
public abstract class AbstractXBeeDevice
Constructors
AbstractXBeeDevice(AbstractXBeeDevice, XBee64BitAddress)
Class constructor. Instantiates a new AbstractXBeeDevice object with the given local XBee device which contains the connection interface to be used.
Declaration
public AbstractXBeeDevice(AbstractXBeeDevice localXBeeDevice, XBee64BitAddress addr64)
Parameters
Type | Name | Description |
---|---|---|
AbstractXBeeDevice | localXBeeDevice | The local XBee device that will behave as connection interface to communicate with the remote XBee device. |
XBee64BitAddress | addr64 | The 64-bit address to identify this XBee device. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If |
System.ArgumentNullException | If |
See Also
AbstractXBeeDevice(AbstractXBeeDevice, XBee64BitAddress, XBee16BitAddress, String)
Class constructor. Instantiates a new AbstractXBeeDevice object with the given local XBee device which contains the connection interface to be used.
Declaration
public AbstractXBeeDevice(AbstractXBeeDevice localXBeeDevice, XBee64BitAddress addr64, XBee16BitAddress addr16, string id)
Parameters
Type | Name | Description |
---|---|---|
AbstractXBeeDevice | localXBeeDevice | The local XBee device that will behave as connection interface to communicate with the remote XBee device. |
XBee64BitAddress | addr64 | The 64-bit address to identify this XBee device. |
XBee16BitAddress | addr16 | The 16-bit address to identify this XBee device. It might be |
System.String | id | The node identifier of this XBee device. It might be |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If |
System.ArgumentNullException | If |
See Also
AbstractXBeeDevice(IConnectionInterface)
Class constructor. Instantiates a new AbstractXBeeDevice object with the given connection interface.
Declaration
public AbstractXBeeDevice(IConnectionInterface connectionInterface)
Parameters
Type | Name | Description |
---|---|---|
IConnectionInterface | connectionInterface | The connection interface with the physical XBee device. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
See Also
Fields
bluetoothPassword
Declaration
protected string bluetoothPassword
Field Value
Type | Description |
---|---|
System.String |
currentFrameID
Declaration
protected byte currentFrameID
Field Value
Type | Description |
---|---|
System.Byte |
dataReader
Declaration
protected DataReader dataReader
Field Value
Type | Description |
---|---|
DataReader |
DEFAULT_RECEIVE_TIMETOUT
Default receive timeout used to wait for a response in synchronous operations.
Declaration
protected const int DEFAULT_RECEIVE_TIMETOUT = 2000
Field Value
Type | Description |
---|---|
System.Int32 |
See Also
localXBeeDevice
Declaration
protected AbstractXBeeDevice localXBeeDevice
Field Value
Type | Description |
---|---|
AbstractXBeeDevice |
logger
Declaration
protected ILog logger
Field Value
Type | Description |
---|---|
Common.Logging.ILog |
network
Declaration
protected XBeeNetwork network
Field Value
Type | Description |
---|---|
XBeeNetwork |
PARAMETER_NODE_ID
Declaration
protected const string PARAMETER_NODE_ID = "NI"
Field Value
Type | Description |
---|---|
System.String |
receiveTimeout
Declaration
protected int receiveTimeout
Field Value
Type | Description |
---|---|
System.Int32 |
TIMEOUT_BEFORE_COMMAND_MODE
Timeout to wait before entering in command mode.
Declaration
protected const int TIMEOUT_BEFORE_COMMAND_MODE = 1200
Field Value
Type | Description |
---|---|
System.Int32 |
Remarks
It is used to determine the operating mode of the module (this library only supports API modes, not transparent mode).
This value depends on the GT
, AT
and/or BT
parameters.
See Also
TIMEOUT_ENTER_COMMAND_MODE
Timeout to wait after entering in command mode.
Declaration
protected const int TIMEOUT_ENTER_COMMAND_MODE = 1500
Field Value
Type | Description |
---|---|
System.Int32 |
Remarks
It is used to determine the operating mode of the module (this library only supports API modes, not transparent mode).
This value depends on the GT
, AT
and/or BT
parameters.
See Also
TIMEOUT_READ_PACKET
Declaration
protected static int TIMEOUT_READ_PACKET
Field Value
Type | Description |
---|---|
System.Int32 |
Properties
APIOutputMode
Indicates the API output mode of the XBee device.
Declaration
protected APIOutputMode APIOutputMode { get; set; }
Property Value
Type | Description |
---|---|
APIOutputMode |
Remarks
The API output mode determines the format that the received data is output through the serial interface of the XBee device.
Exceptions
Type | Condition |
---|---|
ATCommandEmptyException | If the returned value of the API Output Mode command
is |
InterfaceNotOpenException | If this device connection is not open. |
TimeoutException | If there is a timeout sending the given command. |
XBeeException | If there is any other XBee related error. |
See Also
ApplyConfigurationChangesEnabled
The 'apply configuration changes' option for this device.
Declaration
public bool ApplyConfigurationChangesEnabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
Enabling this option means that when any parameter of this XBee device is set, it will be also applied.
If this option is disabled, the method ApplyChanges() must be used in order to apply the changes in all the parameters that were previously set.
ConnectionInterface
The connection interface associated to this XBee device.
Declaration
protected IConnectionInterface ConnectionInterface { get; }
Property Value
Type | Description |
---|---|
IConnectionInterface |
See Also
FirmwareVersion
The firmware version (hexadecimal string value) of this XBee device.
Declaration
public string FirmwareVersion { get; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
To refresh this value use the ReadDeviceInfo() method.
HardwareVersion
The hardware version of this XBee device.
Declaration
public HardwareVersion HardwareVersion { get; }
Property Value
Type | Description |
---|---|
HardwareVersion |
Remarks
If this value is null
, use the ReadDeviceInfo() method
to get its value.
See Also
HardwareVersionString
The hardware version of this XBee device in string format (including the 0x prefix).
Declaration
public string HardwareVersionString { get; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
If this value is empty, use the ReadDeviceInfo() method to get its value.
See Also
IsInitialized
Indicates whether the XBee device is initialized (basic parameters have been read) or not.
Declaration
public bool IsInitialized { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsOpen
The status of the connection interface associated to this device. It indicates if the connection is open or not.
Declaration
protected bool IsOpen { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
See Also
IsRemote
Indicates whether this XBee device is a remote device.
Declaration
public abstract bool IsRemote { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
NodeID
The node identifier of this XBee device.
Declaration
public virtual string NodeID { get; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
To refresh this value use the ReadDeviceInfo() method.
OperatingMode
The Operating mode (AT, API or API escaped) of this XBee device for a local device, and the operating mode of the local device used as communication interface for a remote device.
Declaration
protected OperatingMode OperatingMode { get; set; }
Property Value
Type | Description |
---|---|
OperatingMode |
See Also
ReceiveTimeout
The XBee device timeout in milliseconds for received packets in synchronous operations.
Declaration
protected int ReceiveTimeout { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If the value to be set is lesser than 0. |
SignalStrength
The Signal strength of the device with the parent node. This value is cached at discovery time and it is not read directly from the device.
Declaration
public int SignalStrength { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
XBee16BitAddr
The 16-bit address of this XBee device.
Declaration
public virtual XBee16BitAddress XBee16BitAddr { get; }
Property Value
Type | Description |
---|---|
XBee16BitAddress |
Remarks
To refresh this value, use the ReadDeviceInfo() method.
See Also
XBee64BitAddr
The 64-bit address of this XBee device.
Declaration
public virtual XBee64BitAddress XBee64BitAddr { get; }
Property Value
Type | Description |
---|---|
XBee64BitAddress |
Remarks
If this value is null
or
UNKNOWN_ADDRESS, use the
ReadDeviceInfo() method to get its value.
See Also
XBeeProtocol
The XBee protocol of this XBee device.
Declaration
public virtual XBeeProtocol XBeeProtocol { get; }
Property Value
Type | Description |
---|---|
XBeeProtocol |
Remarks
To refresh this value, use the ReadDeviceInfo() method.
See Also
Methods
ApplyChanges()
Applies changes to all command registers causing queued command register values to be applied.
Declaration
public void ApplyChanges()
Remarks
This method must be invoked if the 'apply configuration changes' option is disabled and the changes to this XBee device parameters must be applied.
To know if the 'apply configuration changes' option is enabled, use the ApplyConfigurationChangesEnabled property. Use it also to enable/disable this feature.
Applying changes does not imply the modifications will persist through subsequent resets. To do so, use the WriteChanges() method.
Exceptions
Type | Condition |
---|---|
InterfaceNotOpenException | If this device connection is not open. |
TimeoutException | If there is a timeout sending apply changes command. |
XBeeException | If there is any other XBee related error. |
See Also
Close()
Closes the connection interface associated with this XBee device.
Declaration
protected void Close()
See Also
CheckATCommandResponseIsValid(ATCommandResponse)
Checks if the provided ATCommandResponse is valid throwing an ATCommandException in case it is not.
Declaration
protected void CheckATCommandResponseIsValid(ATCommandResponse response)
Parameters
Type | Name | Description |
---|---|---|
ATCommandResponse | response | The ATCommandResponse to check. |
Exceptions
Type | Condition |
---|---|
ATCommandException | If |
See Also
DetermineOperatingMode()
Determines the operating mode of this XBee device.
Declaration
protected OperatingMode DetermineOperatingMode()
Returns
Type | Description |
---|---|
OperatingMode | The operating mode of the XBee device. |
Exceptions
Type | Condition |
---|---|
InterfaceNotOpenException | If this device connection is not open. |
OperationNotSupportedException | If the packet is being sent from a remote device. |
XBeeException | If there is any other XBee related error. |
See Also
DisableBluetooth()
Disables the Bluetooth interface of this XBee device.
Declaration
public void DisableBluetooth()
Remarks
Note that your device must have Bluetooth Low Energy support to use this method.
Exceptions
Type | Condition |
---|---|
InterfaceNotOpenException | If this device connection is not open. |
TimeoutException | If there is a timeout disabling the interface. |
XBeeException | If there is any other XBee related error. |
See Also
EnableBluetooth()
Enables the Bluetooth interface of this XBee device.
Declaration
public void EnableBluetooth()
Remarks
To work with this interface, you must also configure the Bluetooth password if not done previously. You can use the UpdateBluetoothPassword(String) method for that purpose. Note that your device must have Bluetooth Low Energy support to use this method.
Exceptions
Type | Condition |
---|---|
InterfaceNotOpenException | If this device connection is not open. |
TimeoutException | If there is a timeout enabling the interface. |
XBeeException | If there is any other XBee related error. |
See Also
ExecuteParameter(String)
Executes the given command in this XBee device.
Declaration
public void ExecuteParameter(string parameter)
Parameters
Type | Name | Description |
---|---|---|
System.String | parameter | The AT command to be executed. |
Remarks
This method is intended to be used for those AT parameters that cannot be read or written, they just execute some action in the XBee module.
Exceptions
Type | Condition |
---|---|
InterfaceNotOpenException | If this device connection is not open. |
TimeoutException | If there is a timeout executing the given command. |
XBeeException | If there is any other XBee related error. |
See Also
ForceDisassociate()
Forces this XBee device to immediately disassociate from the network and re-attempt to associate.
Declaration
protected void ForceDisassociate()
Remarks
Only valid for End Devices.
Exceptions
Type | Condition |
---|---|
InterfaceNotOpenException | If this device connection is not open. |
TimeoutException | If there is a timeout executing the force disassociate command. |
XBeeException | If there is any other XBee related error. |
See Also
GetADCValue(IOLine)
Returns the analog value of the provided IO line of this XBee device.
Declaration
public virtual int GetADCValue(IOLine ioLine)
Parameters
Type | Name | Description |
---|---|---|
IOLine | ioLine | The IO line to get its analog value. |
Returns
Type | Description |
---|---|
System.Int32 | The analog value corresponding to the provided IO line. |
Remarks
The provided IO line must be previously configured as ADC. To do so, use SetIOConfiguration(IOLine, IOMode) and ADC.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If |
InterfaceNotOpenException | If this device connection is not open. |
OperationNotSupportedException | If the IO sample does not contain the expeceted IO line and value. |
TimeoutException | If there is a timeout reading the IO sample data. |
XBeeException | If there is any other XBee related error. |
See Also
GetAddressString()
Returns the address of the device in string format.
Declaration
public string GetAddressString()
Returns
Type | Description |
---|---|
System.String | The address of the device in string format. |
GetAssociationIndicationStatus()
Returns the current association status of this XBee device.
Declaration
protected virtual AssociationIndicationStatus GetAssociationIndicationStatus()
Returns
Type | Description |
---|---|
AssociationIndicationStatus | The association indication status of the XBee device. |
Remarks
It indicates occurrences of errors during the last association request.
Exceptions
Type | Condition |
---|---|
ATCommandEmptyException | If the |
InterfaceNotOpenException | If this device connection is not open. |
TimeoutException | If there is a timeout reading the association indication status. |
XBeeException | If there is any other XBee related error. |
See Also
GetBluetoothMacAddress()
Reads and returns the EUI-48 Bluetooth MAC address of this XBee device in a format such
as 00112233AABB
.
Declaration
public string GetBluetoothMacAddress()
Returns
Type | Description |
---|---|
System.String | The Bluetooth MAC address. |
Remarks
Note that your device must have Bluetooth Low Energy support to use this method.
Exceptions
Type | Condition |
---|---|
InterfaceNotOpenException | If this device connection is not open. |
TimeoutException | If there is a timeout reading the MAC address. |
XBeeException | If there is any other XBee related error. |
GetDestinationAddress()
Returns the 64-bit destination extended address of this XBee device.
Declaration
protected virtual XBee64BitAddress GetDestinationAddress()
Returns
Type | Description |
---|---|
XBee64BitAddress | 64-bit destination address. |
Remarks
BROADCAST_ADDRESS is the broadcast address for the PAN. COORDINATOR_ADDRESS can be used to address the Pan Coordinator.
Exceptions
Type | Condition |
---|---|
ATCommandEmptyException | If |
InterfaceNotOpenException | If this device connection is not open. |
TimeoutException | If there is a timeout reading the destination address. |
XBeeException | If there is any other XBee related error. |
See Also
GetDIOChangeDetection()
Returns the set of IO lines of this device that are monitored for change detection.
Declaration
protected virtual ISet<IOLine> GetDIOChangeDetection()
Returns
Type | Description |
---|---|
System.Collections.Generic.ISet<IOLine> | Set of digital IO lines that are monitored for change detection, |
Remarks
A null
set means the DIO change detection feature is disabled.
Modules can be configured to transmit to the configured destination address a data sample immediately whenever a monitored digital IO line changes state.
Exceptions
Type | Condition |
---|---|
ATCommandEmptyException | If |
InterfaceNotOpenException | If this device connection is not open. |
TimeoutException | If there is a timeout reading the IO change detect command. |
XBeeException | If there is any other XBee related error. |
See Also
GetDIOValue(IOLine)
Returns the digital value of the provided IO line of this XBee device.
Declaration
public virtual IOValue GetDIOValue(IOLine ioLine)
Parameters
Type | Name | Description |
---|---|---|
IOLine | ioLine | The IO line to get its digital value. |
Returns
Type | Description |
---|---|
IOValue |
Remarks
The provided IO line must be previously configured as digital I/O. To do so, use SetIOConfiguration(IOLine, IOMode) and the following IOMode:
- DIGITAL_IN to configure as digital input.
- DIGITAL_OUT_HIGH to configure as digital output, high.
- DIGITAL_OUT_LOW to configure as digital output, low.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If |
InterfaceNotOpenException | If this device connection is not open. |
OperationNotSupportedException | If the sample does not contain the expected IO line and value. |
TimeoutException | If there is a timeout reading the command. |
XBeeException | If there is any other XBee related error. |
See Also
GetIOConfiguration(IOLine)
Returns the configuration mode of the provided IO line of this XBee device.
Declaration
public virtual IOMode GetIOConfiguration(IOLine ioLine)
Parameters
Type | Name | Description |
---|---|---|
IOLine | ioLine | The IO line to get its configuration. |
Returns
Type | Description |
---|---|
IOMode | The IO mode (configuration) of the provided IO line. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If |
ATCommandEmptyException | If the IO line AT command is empty. |
InterfaceNotOpenException | If this device connection is not open. |
OperationNotSupportedException | If the received configuration mode is not valid. |
TimeoutException | If there is a timeout reading the IO command response. |
XBeeException | If there is any other XBee related error. |
See Also
GetIOSamplingRate()
Returns the IO sampling rate of this XBee device.
Declaration
protected virtual int GetIOSamplingRate()
Returns
Type | Description |
---|---|
System.Int32 | IO sampling rate in milliseconds. |
Remarks
A sample rate of 0
ms. means the IO sampling feature is disabled.
Periodic sampling allows this XBee module to take an IO sample and transmit it to a remote device (configured in the destination address) at the configured periodic rate (ms).
Exceptions
Type | Condition |
---|---|
ATCommandEmptyException | If |
InterfaceNotOpenException | If this device connection is not open. |
TimeoutException | If there is a timeout reading the IO sampling rate command. |
XBeeException | If there is any other XBee related error. |
See Also
GetNetwork()
Returns the network associated with this XBee device.
Declaration
protected virtual XBeeNetwork GetNetwork()
Returns
Type | Description |
---|---|
XBeeNetwork | The XBee network of the device. |
Exceptions
Type | Condition |
---|---|
InterfaceNotOpenException | If this device connection is not open. |
See Also
GetNextFrameID()
Gets the next Frame ID of this XBee device.
Declaration
protected byte GetNextFrameID()
Returns
Type | Description |
---|---|
System.Byte | The next Frame ID. |
GetPANID()
Returns the operating PAN ID (Personal Area Network Identifier) of this XBee device.
Declaration
protected byte[] GetPANID()
Returns
Type | Description |
---|---|
System.Byte[] | The operating PAN ID of this XBee device. |
Remarks
For modules to communicate they must be configured with the same identifier. Only modules with matching IDs can communicate with each other. This parameter allows multiple networks to co-exist on the same physical channel.
Exceptions
Type | Condition |
---|---|
ATCommandEmptyException | If the |
InterfaceNotOpenException | If this device connection is not open. |
TimeoutException | If there is a timeout reading the operating PAN ID. |
XBeeException | If there is any other XBee related error. |
See Also
GetParameter(String)
Gets the value of the given parameter from this XBee device.
Declaration
public byte[] GetParameter(string parameter)
Parameters
Type | Name | Description |
---|---|---|
System.String | parameter | The name of the parameter to retrieve its value. |
Returns
Type | Description |
---|---|
System.Byte[] | A byte array containing the value of the parameter. |
Exceptions
Type | Condition |
---|---|
InterfaceNotOpenException | If this device connection is not open. |
TimeoutException | If there is a timeout sending the given command. |
XBeeException | If there is any other XBee related error. |
See Also
GetPowerLevel()
Returns the output power level at which this XBee device transmits conducted power.
Declaration
protected virtual PowerLevel GetPowerLevel()
Returns
Type | Description |
---|---|
PowerLevel | The output power level of this XBee device. |
Exceptions
Type | Condition |
---|---|
ATCommandEmptyException | If the |
InterfaceNotOpenException | If this device connection is not open. |
TimeoutException | If there is a timeout reading the power level command. |
XBeeException | If there is any other XBee related error. |
See Also
GetPWMDutyCycle(IOLine)
Gets the duty cycle (in %) corresponding to the provided IO line of this XBee device.
Declaration
public virtual double GetPWMDutyCycle(IOLine ioLine)
Parameters
Type | Name | Description |
---|---|---|
IOLine | ioLine | The IO line to get its PWM duty cycle. |
Returns
Type | Description |
---|---|
System.Double | The PWM duty cycle value corresponding to the provided IO line (0% - 100%). |
Remarks
The provided IO line must be:
- PWM capable (
IOLine.UNKNOWN.HasPWMCapability()"
). - Previously configured as PWM Output (use SetIOConfiguration(IOLine, IOMode) and PWM).
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If |
ATCommandEmptyException | If the parameter of the IO line is empty. |
InterfaceNotOpenException | If this device connection is not open. |
TimeoutException | If there is a timeout reading the PWM command. |
XBeeException | If there is any other XBee related error. |
See Also
Open()
Opens the connection interface associated with this XBee device.
Declaration
protected virtual void Open()
Remarks
When opening the device an information reading process is automatically performed. This includes:
Exceptions
Type | Condition |
---|---|
InterfaceAlreadyOpenException | If this device connection is already open. |
InvalidOperatingModeException | |
BluetoothAuthenticationException | If the BLE authentication process fails. |
TimeoutException | If the timeout to read settings when initializing the device elapses without response. |
XBeeException | If there is any problem opening this device connection. |
See Also
ReadData()
Reads new data received by this XBee device during the configured receive timeout.
Declaration
protected virtual XBeeMessage ReadData()
Returns
Type | Description |
---|---|
XBeeMessage | An XBeeMessage object containing the data and the source address
of the remote node that sent the data. |
Remarks
This method blocks until new data is received or the configured receive timeout expires.
The receive timeout can be consulted/configured using the ReceiveTimeout property.
Exceptions
Type | Condition |
---|---|
InterfaceNotOpenException | If this device connection is not open. |
See Also
ReadData(Int32)
Reads new data received by this XBee device during the provided timeout.
Declaration
protected virtual XBeeMessage ReadData(int timeout)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | timeout | The time to wait for new data in milliseconds. |
Returns
Type | Description |
---|---|
XBeeMessage | An XBeeMessage object containing the data and the source address of
the remote node that sent the data. |
Remarks
This method blocks until new data is received or the provided timeout expires.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If |
InterfaceNotOpenException | If this device connection is not open. |
See Also
ReadDataFrom(RemoteXBeeDevice)
Reads new data received from the given remote XBee device during the configured received timeout.
Declaration
protected virtual XBeeMessage ReadDataFrom(RemoteXBeeDevice remoteXBeeDevice)
Parameters
Type | Name | Description |
---|---|---|
RemoteXBeeDevice | remoteXBeeDevice | The remote device to read data from. |
Returns
Type | Description |
---|---|
XBeeMessage | An XBeeMessage object containing the data and the source address of
the remote node that sent the data. |
Remarks
This method blocks until new data is received or the provided timeout expires.
The receive timeout can be consulted/configured using the ReceiveTimeout property.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
InterfaceNotOpenException | If this device connection is not open. |
See Also
ReadDataFrom(RemoteXBeeDevice, Int32)
Reads new data received from the given remote XBee device during the provided timeout.
Declaration
protected virtual XBeeMessage ReadDataFrom(RemoteXBeeDevice remoteXBeeDevice, int timeout)
Parameters
Type | Name | Description |
---|---|---|
RemoteXBeeDevice | remoteXBeeDevice | The remote device to read data from. |
System.Int32 | timeout | The time to wait for new data in milliseconds. |
Returns
Type | Description |
---|---|
XBeeMessage | An XBeeMessage object containing the data and the source address
of the remote node that sent the data. |
Remarks
This method blocks until new data from the provided remote XBee device is received or the given timeout expires.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If |
System.ArgumentNullException | If |
InterfaceNotOpenException | If this device connection is not open. |
See Also
ReadDeviceInfo()
Reads some parameters from this device and obtains its protocol.
Declaration
public virtual void ReadDeviceInfo()
Remarks
This method refresh the values of:
- 64-bit address only if it is not initialized.
- Node Identifier.
- Hardware version if it is not initialized.
- Firmware version.
- XBee device protocol.
- 16-bit address (not for DigiMesh modules).
Exceptions
Type | Condition |
---|---|
InterfaceNotOpenException | If this device connection is not open. |
TimeoutException | If there is a timeout reading the parameters. |
XBeeException | If there is any other XBee related error. |
See Also
ReadExplicitData()
Reads new explicit data received by this XBee device during the configured receive timeout.
Declaration
protected ExplicitXBeeMessage ReadExplicitData()
Returns
Type | Description |
---|---|
ExplicitXBeeMessage | An ExplicitXBeeMessage object containing the explicit data, the source
address of the remote node that sent the data and other values related to the transmission.
|
Remarks
This method blocks until new explicit data is received or the configured receive timeout expires.
For non-blocking operations, register an event handler to ExplicitDataReceived.
Exceptions
Type | Condition |
---|---|
InterfaceNotOpenException | If the interface is not open. |
See Also
ReadExplicitData(Int32)
Reads new explicit data received by this XBee device during the configured receive timeout.
Declaration
protected ExplicitXBeeMessage ReadExplicitData(int timeout)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | timeout | The time to wait for new explicit data in milliseconds. |
Returns
Type | Description |
---|---|
ExplicitXBeeMessage | An ExplicitXBeeMessage object containing the explicit data, the source
address of the remote node that sent the data and other values related to the transmission.
|
Remarks
This method blocks until new explicit data is received or the configured receive timeout expires.
For non-blocking operations, register an event handler to ExplicitDataReceived.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If |
InterfaceNotOpenException | If the interface is not open. |
See Also
ReadExplicitDataFrom(RemoteXBeeDevice)
Reads new explicit data received from the given remote XBee device during the configured receive timeout.
Declaration
protected ExplicitXBeeMessage ReadExplicitDataFrom(RemoteXBeeDevice remoteXBeeDevice)
Parameters
Type | Name | Description |
---|---|---|
RemoteXBeeDevice | remoteXBeeDevice | The remote device to read explicit data from. |
Returns
Type | Description |
---|---|
ExplicitXBeeMessage | An ExplicitXBeeMessage object containing the explicit data, the
source address of the remote node that sent the data and other values related to the
transmission. |
Remarks
This method blocks until new explicit data from the provided remote XBee device is received or the configured receive timeout expires.
For non-blocking operations, register an event handler to ExplicitDataReceived.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
InterfaceNotOpenException | If the interface is not open. |
See Also
ReadExplicitDataFrom(RemoteXBeeDevice, Int32)
Reads new explicit data received from the given remote XBee device during the provided timeout.
Declaration
protected ExplicitXBeeMessage ReadExplicitDataFrom(RemoteXBeeDevice remoteXBeeDevice, int timeout)
Parameters
Type | Name | Description |
---|---|---|
RemoteXBeeDevice | remoteXBeeDevice | The remote device to read explicit data from. |
System.Int32 | timeout | The time to wait for new explicit data in milliseconds. |
Returns
Type | Description |
---|---|
ExplicitXBeeMessage | An ExplicitXBeeMessage object containing the explicit data, the source
address of the remote node that sent the data and other values related to the transmission.
|
Remarks
This method blocks until new explicit data from the provided remote XBee device is received or the given timeout expires.
For non-blocking operations, register an event handler to ExplicitDataReceived.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If |
System.ArgumentNullException | If |
InterfaceNotOpenException | If the interface is not open. |
See Also
ReadIOSample()
Returns an IO sample from this XBee device containing the value of all enabled digital IO and analog input channels.
Declaration
public virtual IOSample ReadIOSample()
Returns
Type | Description |
---|---|
IOSample | An IO sample containing the value of all enabled digital IO and analog input channels. |
Exceptions
Type | Condition |
---|---|
ATCommandEmptyException | If |
InterfaceNotOpenException | If this device connection is not open. |
TimeoutException | If there is a timeout getting the IO sample. |
XBeeException | If there is any other XBee related error. |
See Also
ReadUserDataRelay()
Reads a new User Data Relay packet received by this XBee device during the configured receive timeout.
Declaration
protected UserDataRelayMessage ReadUserDataRelay()
Returns
Type | Description |
---|---|
UserDataRelayMessage | A UserDataRelayMessage object containing the source interface and data.
|
Remarks
This method blocks until new User Data Relay is received or the configured receive timeout expires.
Exceptions
Type | Condition |
---|---|
InterfaceNotOpenException | If the interface is not open. |
See Also
ReadUserDataRelay(Int32)
Reads a new User Data Relay packet received by this XBee device during the provided timeout.
Declaration
protected UserDataRelayMessage ReadUserDataRelay(int timeout)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | timeout | The time to wait for new User Data Relay in milliseconds. |
Returns
Type | Description |
---|---|
UserDataRelayMessage | A UserDataRelayMessage object containing the source interface and data.
|
Remarks
This method blocks until new User Data Relay is received or the given timeout expires.
Exceptions
Type | Condition |
---|---|
InterfaceNotOpenException | If the interface is not open. |
See Also
Reset()
Performs a software reset on this XBee device and blocks until the process is completed.
Declaration
public abstract void Reset()
SendAndCheckXBeePacket(XBeePacket, Boolean)
Sends the provided XBeePacket and determines if the transmission status is success for synchronous transmissions.
Declaration
protected void SendAndCheckXBeePacket(XBeePacket packet, bool asyncTransmission)
Parameters
Type | Name | Description |
---|---|---|
XBeePacket | packet | The XBeePacket to be sent. |
System.Boolean | asyncTransmission | Determines whether the transmission must be asynchronous. |
Remarks
If the status is not success, an TransmitException is thrown.
Exceptions
Type | Condition |
---|---|
InterfaceNotOpenException | If this device connection is not open. |
TimeoutException | If there is a timeout sending the given packet synchronously. |
TransmitException | If the received packet is not an instance of TransmitStatusPacket
or if |
XBeeException | If there is any other XBee related error. |
See Also
SendATCommand(ATCommand)
Sends the given AT command and waits for answer or until the configured receive timeout expires.
Declaration
protected ATCommandResponse SendATCommand(ATCommand command)
Parameters
Type | Name | Description |
---|---|---|
ATCommand | command | The AT command to be sent. |
Returns
Type | Description |
---|---|
ATCommandResponse | An ATCommandResponse object containing the response of the command or
|
Remarks
The receive timeout can be consulted/configured using the ReceiveTimeout property.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
InterfaceNotOpenException | If this device connection is not open. |
InvalidOperatingModeException | If the operating mode is different from API and API_ESCAPE. |
System.InvalidCastException | If the received packet is invalid. |
TimeoutException | If there is a timeout sending the given AT command. |
XBeeException | If there is any other XBee related error. |
See Also
SendBluetoothData(Byte[])
Sends the given data to the XBee Bluetooth interface in a User Data Relay frame.
Declaration
protected void SendBluetoothData(byte[] data)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | Data to send. |
Exceptions
Type | Condition |
---|---|
XBeeException | If there is any XBee related error sending the Bluetooth data. |
See Also
SendBroadcastData(Byte[])
Sends the provided data to all the XBee nodes of the network (broadcast).
Declaration
protected virtual void SendBroadcastData(byte[] data)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | Byte array containing the data to be sent. |
Remarks
This method blocks till a success or error transmit status arrives or the configured receive timeout expires.
The receive timeout can be consulted/configured using the ReceiveTimeout property.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
InterfaceNotOpenException | If this device connection is not open. |
OperationNotSupportedException | If the sender device is remote. |
TimeoutException | If there is a timeout sending the data. |
TransmitException | If the transmit status generated when sending the packet is not an instance of TransmitStatusPacket or if it is not an instance of TXStatusPacket or if when it is correct, its status is different from SUCCESS. |
XBeeException | If there is any other XBee related error. |
See Also
SendBroadcastExplicitData(Byte, Byte, Byte[], Byte[], Byte[])
Sends the provided data to all the XBee nodes of the network (broadcast) in application layer mode. Application layer mode means that you need to specify the application layer fields to be sent with the data.
Declaration
protected void SendBroadcastExplicitData(byte sourceEndpoint, byte destEndpoint, byte[] clusterID, byte[] profileID, byte[] data)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | sourceEndpoint | Source endpoint for the transmission. |
System.Byte | destEndpoint | Destination endpoint for the transmission. |
System.Byte[] | clusterID | Cluster ID used in the transmission. |
System.Byte[] | profileID | Profile ID used in the transmission. |
System.Byte[] | data | Byte array containing the data to be sent. |
Remarks
This method blocks till a success or error response arrives or the configured receive timeout expires.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
System.ArgumentException | If |
InterfaceNotOpenException | If the interface is not open. |
OperationNotSupportedException | If the protocol of the device is RAW_802_15_4 or if the sender device is remote. |
TimeoutException | If there is a timeout sending the given packet synchronously. |
TransmitException | If the transmit status generated when sending the packet is not an instance of TransmitStatusPacket or if it is not an instance of TXStatusPacket or if when it is correct, its status is different from SUCCESS. |
XBeeException | If there is any other XBee related error. |
SendData(XBee64BitAddress, Byte[])
Sends the provided data to the XBee device of the network corresponding to the given 64-bit address.
Declaration
protected void SendData(XBee64BitAddress address, byte[] data)
Parameters
Type | Name | Description |
---|---|---|
XBee64BitAddress | address | The 64-bit address of the XBee that will receive the data. |
System.Byte[] | data | Byte array containing the data to be sent. |
Remarks
This method blocks till a success or error response arrives or the configured receive timeout expires.
The receive timeout is consulted/configured using the ReceiveTimeout property.
For non-blocking operations use the method SendDataAsync(XBee64BitAddress, Byte[]).
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
InterfaceNotOpenException | If this device connection is not open. |
OperationNotSupportedException | If the sender device is remote. |
TimeoutException | If there is a timeout sending the data. |
TransmitException | If the transmit status generated when sending the packet is not an instance of TransmitStatusPacket or if it is not an instance of TXStatusPacket or if when it is correct, its status is different from SUCCESS. |
XBeeException | If there is any other XBee related error. |
See Also
SendData(XBee64BitAddress, XBee16BitAddress, Byte[])
Sends the provided data to the XBee device of the network corresponding to the given 64-bit/16-bit address.
Declaration
protected void SendData(XBee64BitAddress address64Bit, XBee16BitAddress address16bit, byte[] data)
Parameters
Type | Name | Description |
---|---|---|
XBee64BitAddress | address64Bit | The 64-bit address of the XBee that will receive the data. |
XBee16BitAddress | address16bit | The 16-bit address of the XBee that will receive the data.If it is unknown the UNKNOWN_ADDRESS must be used. |
System.Byte[] | data | Byte array containing the data to be sent. |
Remarks
This method blocks till a success or error response arrives or the configured receive timeout expires.
The receive timeout is consulted/configured using the ReceiveTimeout property.
For non-blocking operations use the method SendDataAsync(XBee64BitAddress, XBee16BitAddress, Byte[]).
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
InterfaceNotOpenException | If this device connection is not open. |
OperationNotSupportedException | If the sender device is remote. |
TimeoutException | If there is a timeout sending the data. |
TransmitException | If the transmit status generated when sending the packet is not an instance of TransmitStatusPacket or if it is not an instance of TXStatusPacket or if when it is correct, its status is different from SUCCESS. |
XBeeException | If there is any other XBee related error. |
See Also
SendData(RemoteXBeeDevice, Byte[])
Sends the provided data to the given XBee device choosing the optimal send method depending on the protocol of the local XBee device.
Declaration
protected virtual void SendData(RemoteXBeeDevice xbeeDevice, byte[] data)
Parameters
Type | Name | Description |
---|---|---|
RemoteXBeeDevice | xbeeDevice | The XBee device of the network that will receive the data. |
System.Byte[] | data | Byte array containing the data to be sent. |
Remarks
This method blocks till a success or error response arrives or the configured receive timeout expires.
The receive timeout can be consulted/configured using the ReceiveTimeout property.
For non-blocking operations use the method SendDataAsync(RemoteXBeeDevice, Byte[]).
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
InterfaceNotOpenException | If this device connection is not open. |
OperationNotSupportedException | If the sender device is remote. |
TimeoutException | If there is a timeout sending the data. |
TransmitException | If the transmit status generated when sending the packet is not an instance of TransmitStatusPacket or if it is not an instance of TXStatusPacket or if when it is correct, its status is different from SUCCESS. |
XBeeException | If there is any other XBee related error. |
See Also
SendDataAsync(XBee64BitAddress, Byte[])
Sends asynchronously the provided data to the XBee device of the network corresponding to the given 64-bit address.
Declaration
protected void SendDataAsync(XBee64BitAddress address, byte[] data)
Parameters
Type | Name | Description |
---|---|---|
XBee64BitAddress | address | The 64-bit address of the XBee that will receive the data. |
System.Byte[] | data | Byte array containing the data to be sent. |
Remarks
Asynchronous transmissions do not wait for answer from the remote device or for transmit status packet.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
InterfaceNotOpenException | If this device connection is not open. |
OperationNotSupportedException | If the sender device is remote. |
XBeeException | If there is any other XBee related error. |
See Also
SendDataAsync(XBee64BitAddress, XBee16BitAddress, Byte[])
Sends asynchronously the provided data to the XBee device of the network corresponding to the given 64-bit/16-bit address.
Declaration
protected void SendDataAsync(XBee64BitAddress address64Bit, XBee16BitAddress address16bit, byte[] data)
Parameters
Type | Name | Description |
---|---|---|
XBee64BitAddress | address64Bit | The 64-bit address of the XBee that will receive the data. |
XBee16BitAddress | address16bit | The 16-bit address of the XBee that will receive the data.If it is unknown the UNKNOWN_ADDRESS must be used. |
System.Byte[] | data | Byte array containing the data to be sent. |
Remarks
Asynchronous transmissions do not wait for answer from the remote device or for transmit status packet.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
InterfaceNotOpenException | If this device connection is not open. |
OperationNotSupportedException | If the sender device is remote. |
XBeeException | If there is any other XBee related error. |
See Also
SendDataAsync(RemoteXBeeDevice, Byte[])
Sends the provided data to the provided XBee device asynchronously.
Declaration
protected virtual void SendDataAsync(RemoteXBeeDevice xbeeDevice, byte[] data)
Parameters
Type | Name | Description |
---|---|---|
RemoteXBeeDevice | xbeeDevice | The XBee device of the network that will receive the data. |
System.Byte[] | data | Byte array containing the data to be sent. |
Remarks
Asynchronous transmissions do not wait for answer from the remote device or for transmit status packet.
Exceptions
Type | Condition |
---|---|
InterfaceNotOpenException | If this device connection is not open. |
System.ArgumentNullException | If |
InterfaceNotOpenException | If this device connection is not open. |
OperationNotSupportedException | If the sender device is remote. |
XBeeException | If there is any other XBee related error. |
See Also
SendExplicitData(XBee64BitAddress, Byte, Byte, Byte[], Byte[], Byte[])
Sends the provided data in application layer mode to the XBee device of the network corresponding to the given 64-bit address. Application layer mode means that you need to specify the application layer fields to be sent with the data.
Declaration
protected void SendExplicitData(XBee64BitAddress address, byte sourceEndpoint, byte destEndpoint, byte[] clusterID, byte[] profileID, byte[] data)
Parameters
Type | Name | Description |
---|---|---|
XBee64BitAddress | address | The 64-bit address of the XBee that will receive the data. |
System.Byte | sourceEndpoint | Source endpoint for the transmission. |
System.Byte | destEndpoint | Destination endpoint for the transmission. |
System.Byte[] | clusterID | Cluster ID used in the transmission. |
System.Byte[] | profileID | Profile ID used in the transmission. |
System.Byte[] | data | Byte array containing the data to be sent. |
Remarks
This method blocks till a success or error response arrives or the configured receive timeout expires.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
System.ArgumentException | If |
InterfaceNotOpenException | If the interface is not open. |
OperationNotSupportedException | If the sender device is remote. |
TimeoutException | If there is a timeout sending the given packet synchronously. |
TransmitException | If the transmit status generated when sending the packet is not an instance of TransmitStatusPacket or if it is not an instance of TXStatusPacket or if when it is correct, its status is different from SUCCESS. |
XBeeException | If there is any other XBee related error. |
See Also
SendExplicitData(XBee64BitAddress, XBee16BitAddress, Byte, Byte, Byte[], Byte[], Byte[])
Sends the provided data in application layer mode to the XBee device of the network corresponding to the given 64-bit/16-bit address. Application layer mode means that you need to specify the application layer fields to be sent with the data.
Declaration
protected void SendExplicitData(XBee64BitAddress address64Bits, XBee16BitAddress address16Bits, byte sourceEndpoint, byte destEndpoint, byte[] clusterID, byte[] profileID, byte[] data)
Parameters
Type | Name | Description |
---|---|---|
XBee64BitAddress | address64Bits | The 64-bit address of the XBee that will receive the data. |
XBee16BitAddress | address16Bits | The 16-bit address of the XBee that will receive the data. If it is unknown the UNKNOWN_ADDRESS must be used. |
System.Byte | sourceEndpoint | Source endpoint for the transmission. |
System.Byte | destEndpoint | Destination endpoint for the transmission. |
System.Byte[] | clusterID | Cluster ID used in the transmission. |
System.Byte[] | profileID | Profile ID used in the transmission. |
System.Byte[] | data | Byte array containing the data to be sent. |
Remarks
This method blocks till a success or error response arrives or the configured receive timeout expires.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
System.ArgumentException | If |
OperationNotSupportedException | If the sender device is remote. |
TimeoutException | If there is a timeout sending the given packet synchronously. |
TransmitException | If the transmit status generated when sending the packet is not an instance of TransmitStatusPacket or if it is not an instance of TXStatusPacket or if when it is correct, its status is different from SUCCESS. |
XBeeException | If there is any other XBee related error. |
See Also
SendExplicitData(RemoteXBeeDevice, Byte, Byte, Byte[], Byte[], Byte[])
Sends 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. Application layer mode means that you need to specify the application layer fields to be sent with the data.
Declaration
protected void SendExplicitData(RemoteXBeeDevice remoteXBeeDevice, byte sourceEndpoint, byte destEndpoint, byte[] clusterID, byte[] profileID, byte[] data)
Parameters
Type | Name | Description |
---|---|---|
RemoteXBeeDevice | remoteXBeeDevice | The XBee device of the network that will receive the data. |
System.Byte | sourceEndpoint | Source endpoint for the transmission. |
System.Byte | destEndpoint | Destination endpoint for the transmission. |
System.Byte[] | clusterID | Cluster ID used in the transmission. |
System.Byte[] | profileID | Profile ID used in the transmission. |
System.Byte[] | data | Byte array containing the data to be sent. |
Remarks
This method blocks till a success or error response arrives or the configured receive timeout expires.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
System.ArgumentException | If |
InterfaceNotOpenException | If the interface is not open. |
OperationNotSupportedException | If the device protocol is RAW_802_15_4 or if the sender device is remote. |
TimeoutException | If there is a timeout sending the given packet synchronously. |
TransmitException | If the transmit status generated when sending the packet is not an instance of TransmitStatusPacket or if it is not an instance of TXStatusPacket or if when it is correct, its status is different from SUCCESS. |
XBeeException | If there is any other XBee related error. |
See Also
SendExplicitDataAsync(XBee64BitAddress, Byte, Byte, Byte[], Byte[], Byte[])
Sends asynchronously the provided data in application layer mode to the XBee device of the network corresponding to the given 64-bit address. Application layer mode means that you need to specify the application layer fields to be sent with the data.
Declaration
protected void SendExplicitDataAsync(XBee64BitAddress address, byte sourceEndpoint, byte destEndpoint, byte[] clusterID, byte[] profileID, byte[] data)
Parameters
Type | Name | Description |
---|---|---|
XBee64BitAddress | address | The 64-bit address of the XBee that will receive the data. |
System.Byte | sourceEndpoint | Source endpoint for the transmission. |
System.Byte | destEndpoint | Destination endpoint for the transmission. |
System.Byte[] | clusterID | Cluster ID used in the transmission. |
System.Byte[] | profileID | Profile ID used in the transmission. |
System.Byte[] | data | Byte array containing the data to be sent. |
Remarks
Asynchronous transmissions do not wait for answer from the remote device or for transmit status packet.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If |
System.ArgumentNullException | If |
InterfaceNotOpenException | If the interface is not open. |
OperationNotSupportedException | If the sender device is remote. |
XBeeException | If there is any other XBee related error. |
See Also
SendExplicitDataAsync(XBee64BitAddress, XBee16BitAddress, Byte, Byte, Byte[], Byte[], Byte[])
Sends asynchronously the provided data in application layer mode to the XBee device of the network corresponding to the given 64-bit/16-bit address. Application layer mode means that you need to specify the application layer fields to be sent with the data.
Declaration
protected void SendExplicitDataAsync(XBee64BitAddress address64Bits, XBee16BitAddress address16Bits, byte sourceEndpoint, byte destEndpoint, byte[] clusterID, byte[] profileID, byte[] data)
Parameters
Type | Name | Description |
---|---|---|
XBee64BitAddress | address64Bits | The 64-bit address of the XBee that will receive the data. |
XBee16BitAddress | address16Bits | The 16-bit address of the XBee that will receive the data. If it is unknown the UNKNOWN_ADDRESS must be used. |
System.Byte | sourceEndpoint | Source endpoint for the transmission. |
System.Byte | destEndpoint | Destination endpoint for the transmission. |
System.Byte[] | clusterID | Cluster ID used in the transmission. |
System.Byte[] | profileID | Profile ID used in the transmission. |
System.Byte[] | data | Byte array containing the data to be sent. |
Remarks
Asynchronous transmissions do not wait for answer from the remote device or for transmit status packet.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If |
System.ArgumentNullException | If |
InterfaceNotOpenException | If the interface is not open. |
OperationNotSupportedException | If the sender device is remote. |
XBeeException | If there is any other XBee related error. |
See Also
SendExplicitDataAsync(RemoteXBeeDevice, Byte, Byte, Byte[], Byte[], Byte[])
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. Application layer mode means that you need to specify the application layer fields to be sent with the data.
Declaration
protected void SendExplicitDataAsync(RemoteXBeeDevice remoteXBeeDevice, byte sourceEndpoint, byte destEndpoint, byte[] clusterID, byte[] profileID, byte[] data)
Parameters
Type | Name | Description |
---|---|---|
RemoteXBeeDevice | remoteXBeeDevice | The XBee device of the network that will receive the data. |
System.Byte | sourceEndpoint | Source endpoint for the transmission. |
System.Byte | destEndpoint | Destination endpoint for the transmission. |
System.Byte[] | clusterID | Cluster ID used in the transmission. |
System.Byte[] | profileID | Profile ID used in the transmission. |
System.Byte[] | data | Byte array containing the data to be sent. |
Remarks
Asynchronous transmissions do not wait for answer from the remote device or for transmit status packet.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If |
System.ArgumentNullException | If |
InterfaceNotOpenException | If the interface is not open. |
OperationNotSupportedException | If the sender device is remote or if the protocol is RAW_802_15_4. |
XBeeException | If there is any other XBee related error. |
See Also
SendMicroPythonData(Byte[])
Sends the given data to the XBee MicroPython interface in a User Data Relay frame.
Declaration
protected void SendMicroPythonData(byte[] data)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | Data to send. |
Exceptions
Type | Condition |
---|---|
XBeeException | If there is any XBee related error sending the MicroPython data. |
See Also
SendPacket(XBeePacket)
Sends the given XBee packet synchronously and blocks until the response is received or the configured receive timeout expires.
Declaration
protected XBeePacket SendPacket(XBeePacket packet)
Parameters
Type | Name | Description |
---|---|---|
XBeePacket | packet | The XBee packet to be sent. |
Returns
Type | Description |
---|---|
XBeePacket | An XBeePacket object containing the response of the sent packet or
|
Remarks
The receive timeout is consulted/configured using the ReceiveTimeoutproperty.
Use SendPacketAsync(XBeePacket) or SendPacket(XBeePacket, EventHandler<PacketReceivedEventArgs>) for non-blocking operations.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
InterfaceNotOpenException | If this device connection is not open. |
InvalidOperatingModeException | If the operating mode is different from API and API_ESCAPE. |
TimeoutException | If the configured time expires while waiting for the packet reply. |
XBeeException | If there is any other XBee related error. |
See Also
SendPacket(XBeePacket, EventHandler<PacketReceivedEventArgs>)
Sends the given XBee packet and registers the given packet handler (if not null
) to
manage what happens when the answer is received.
Declaration
protected void SendPacket(XBeePacket packet, EventHandler<PacketReceivedEventArgs> handler)
Parameters
Type | Name | Description |
---|---|---|
XBeePacket | packet | XBee packet to be sent. |
System.EventHandler<PacketReceivedEventArgs> | handler | Event handler for the operation, |
Remarks
This is a non-blocking operation. To wait for the answer use SendPacket(XBeePacket).
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
InterfaceNotOpenException | If this device connection is not open. |
InvalidOperatingModeException | If the operating mode is different from API and API_ESCAPE. |
XBeeException | If there is any other XBee related error. |
See Also
SendPacketAsync(XBeePacket)
Sends the given XBee packet asynchronously.
Declaration
protected void SendPacketAsync(XBeePacket packet)
Parameters
Type | Name | Description |
---|---|---|
XBeePacket | packet | The XBee packet to be sent asynchronously. |
Remarks
To be notified when the answer is received, use the PacketReceived event handler.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
InterfaceNotOpenException | If this device connection is not open. |
InvalidOperatingModeException | If the operating mode is different from API and API_ESCAPE. |
XBeeException | If there is any other XBee related error. |
See Also
SendSerialData(Byte[])
Sends the given data to the XBee serial interface in a User Data Relay frame.
Declaration
protected void SendSerialData(byte[] data)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | Data to send. |
Exceptions
Type | Condition |
---|---|
XBeeException | If there is any XBee related error sending the serial data. |
See Also
SendUserDataRelay(XBeeLocalInterface, Byte[])
Sends the provided data to the given XBee local interface.
Declaration
protected void SendUserDataRelay(XBeeLocalInterface destinationInterface, byte[] data)
Parameters
Type | Name | Description |
---|---|---|
XBeeLocalInterface | destinationInterface | Destination XBee local interface. |
System.Byte[] | data | Data to send. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If the destination interface is unknown. |
XBeeException | If there is any XBee related error sending the User Data Relay. |
See Also
SendXBeePacket(XBeePacket)
Sends the given XBee packet synchronously and and blocks until response is received or receive timeout is reached.
Declaration
protected XBeePacket SendXBeePacket(XBeePacket packet)
Parameters
Type | Name | Description |
---|---|---|
XBeePacket | packet | XBee packet to be sent. |
Returns
Type | Description |
---|---|
XBeePacket | An XBeePacket that contains the response of the sent packet or |
Remarks
The receive timeout can be consulted/configured using the ReceiveTimeout property.
Use SendXBeePacketAsync(XBeePacket) for non-blocking operations.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
InterfaceNotOpenException | If this device connection is not open. |
InvalidOperatingModeException | If the operating mode is different from API and API_ESCAPE. |
TimeoutException | If the configured time expires while waiting for the packet reply. |
XBeeException | If there is any other XBee related error. |
See Also
SendXBeePacket(XBeePacket, EventHandler<PacketReceivedEventArgs>)
Sends the given XBee packet asynchronously and registers the given packet event handler (if
not null
) to wait for an answer.
Declaration
protected void SendXBeePacket(XBeePacket packet, EventHandler<PacketReceivedEventArgs> handler)
Parameters
Type | Name | Description |
---|---|---|
XBeePacket | packet | XBee packet to be sent. |
System.EventHandler<PacketReceivedEventArgs> | handler | Event handler for the operation, |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
InterfaceNotOpenException | If this device connection is not open. |
InvalidOperatingModeException | If the operating mode is different from API and API_ESCAPE. |
XBeeException | If there is any other XBee related error. |
See Also
SendXBeePacketAsync(XBeePacket)
Sends the given XBee packet asynchronously.
Declaration
protected void SendXBeePacketAsync(XBeePacket packet)
Parameters
Type | Name | Description |
---|---|---|
XBeePacket | packet | XBee packet to be sent. |
Remarks
The method will not wait for an answer for the packet.
To be notified when the answer is received, use SendXBeePacket(XBeePacket, EventHandler<PacketReceivedEventArgs>).
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
InterfaceNotOpenException | If this device connection is not open. |
InvalidOperatingModeException | If the operating mode is different from API and API_ESCAPE. |
XBeeException | If there is any other XBee related error. |
See Also
SetBluetoothPassword(String)
Sets the password of this Bluetooth device in order to connect to it.
Declaration
protected void SetBluetoothPassword(string password)
Parameters
Type | Name | Description |
---|---|---|
System.String | password | The password of this Bluetooth device. |
Remarks
The Bluetooth password must be provided before calling the Open() method.
SetDestinationAddress(XBee64BitAddress)
Sets the 64-bit destination extended address of this XBee device.
Declaration
protected virtual void SetDestinationAddress(XBee64BitAddress xbee64BitAddress)
Parameters
Type | Name | Description |
---|---|---|
XBee64BitAddress | xbee64BitAddress | 64-bit destination address to be configured. |
Remarks
BROADCAST_ADDRESS is the broadcast address for the PAN. COORDINATOR_ADDRESS can be used to address the Pan Coordinator.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
InterfaceNotOpenException | If this device connection is not open. |
TimeoutException | If there is a timeout setting the destination address. |
XBeeException | If there is any other XBee related error. |
See Also
SetDIOChangeDetection(ISet<IOLine>)
Sets the digital IO lines of this XBee device to be monitored and sampled whenever their status changes.
Declaration
protected virtual void SetDIOChangeDetection(ISet<IOLine> lines)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.ISet<IOLine> | lines | Set of IO lines to be monitored, |
Remarks
A null
set of lines disables this feature.
If a change is detected on an enabled digital IO pin, a digital IO sample is immediately transmitted to the configured destination address.
The destination address can be configured using the SetDestinationAddress(XBee64BitAddress) method and retrieved by GetDestinationAddress().
Exceptions
Type | Condition |
---|---|
InterfaceNotOpenException | If this device connection is not open. |
TimeoutException | If there is a timeout sending the set IO change detect command. |
XBeeException | If there is any other XBee related error. |
See Also
SetDIOValue(IOLine, IOValue)
Sets the digital value (high or low) to the provided IO line of this XBee device.
Declaration
public virtual void SetDIOValue(IOLine ioLine, IOValue ioValue)
Parameters
Type | Name | Description |
---|---|---|
IOLine | ioLine | The IO line to set its value. |
IOValue | ioValue |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | |
InterfaceNotOpenException | If this device connection is not open. |
TimeoutException | If there is a timeout sending the set configuration command. |
XBeeException | If there is any other XBee related error. |
See Also
SetIOConfiguration(IOLine, IOMode)
Sets the configuration of the given IO line of this XBee device.
Declaration
public virtual void SetIOConfiguration(IOLine ioLine, IOMode ioMode)
Parameters
Type | Name | Description |
---|---|---|
IOLine | ioLine | The IO line to configure. |
IOMode | ioMode | The IO mode to set to the IO line. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | |
InterfaceNotOpenException | If this device connection is not open. |
TimeoutException | If there is a timeout sending the set configuration command. |
XBeeException | If there is any other XBee related error. |
See Also
SetIOSamplingRate(Int32)
Sets the IO sampling rate to enable periodic sampling in this XBee device.
Declaration
protected virtual void SetIOSamplingRate(int rate)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rate | IO sampling rate in milliseconds. |
Remarks
A sample rate of 0
ms. disables this feature.
All enabled digital IO and analog inputs will be sampled and transmitted every rate
milliseconds to the configured destination address.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If |
InterfaceNotOpenException | If this device connection is not open. |
TimeoutException | If there is a timeout sending the set IO sampling rate command. |
XBeeException | If there is any other XBee related error. |
See Also
SetNodeID(String)
Sets the Node Identifier on the device.
Declaration
public virtual void SetNodeID(string nodeId)
Parameters
Type | Name | Description |
---|---|---|
System.String | nodeId | The new Node ID. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If the length of the value to be set is greater than 20 characters. |
System.ArgumentNullException | If the value to set is |
InterfaceNotOpenException | If this device connection is not open. |
TimeoutException | If there is a timeout setting the node identifier command. |
XBeeException | If there is any other XBee related error. |
SetPANID(Byte[])
Sets the PAN ID (Personal Area Network Identifier) of this XBee device.
Declaration
protected virtual void SetPANID(byte[] panID)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | panID | The new PAN ID of this XBee device. |
Remarks
For modules to communicate they must be configured with the same identifier. Only modules with matching IDs can communicate with each other. This parameter allows multiple networks to co-exist on the same physical channel.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If the length of |
System.ArgumentNullException | If |
InterfaceNotOpenException | If this device connection is not open. |
TimeoutException | If there is a timeout setting the operating PAN ID. |
XBeeException | If there is any other XBee related error. |
See Also
SetParameter(String, Byte[])
Sets the given parameter with the provided value in this XBee device.
Declaration
public void SetParameter(string parameter, byte[] parameterValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | parameter | The name of the parameter to be set. |
System.Byte[] | parameterValue | The value of the parameter to set. |
Remarks
If the 'apply configuration changes' option is enabled in this device, the configured value for the given parameter will be immediately applied, if not the method ApplyChanges() must be invoked to apply it.
Use ApplyConfigurationChangesEnabled to know if the 'apply configuration changes' option is enabled, and also to enable/disable it.
To make parameter modifications persist through subsequent resets use the WriteChanges() method.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If |
InterfaceNotOpenException | If this device connection is not open. |
TimeoutException | If there is a timeout sending the set configuration command. |
XBeeException | If there is any other XBee related error. |
See Also
SetPowerLevel(PowerLevel)
Sets the output power level at which this XBee device transmits conducted power.
Declaration
protected virtual void SetPowerLevel(PowerLevel powerLevel)
Parameters
Type | Name | Description |
---|---|---|
PowerLevel | powerLevel | The new output power level to be set in this XBee device. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If |
InterfaceNotOpenException | If this device connection is not open. |
TimeoutException | If there is a timeout setting the power level command. |
XBeeException | If there is any other XBee related error. |
See Also
SetPWMDutyCycle(IOLine, Double)
Sets the duty cycle (in %) of the provided IO line of this XBee device.
Declaration
public virtual void SetPWMDutyCycle(IOLine ioLine, double dutyCycle)
Parameters
Type | Name | Description |
---|---|---|
IOLine | ioLine | The IO line to set its duty cycle value. |
System.Double | dutyCycle | The duty cycle of the PWM. |
Remarks
The provided IO line must be:
- PWM capable (
IOLine.UNKNOWN.HasPWMCapability()
). - Previously configured as PWM Output (use SetIOConfiguration(IOLine, IOMode) and PWM).
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If |
InterfaceNotOpenException | If this device connection is not open. |
TimeoutException | If there is a timeout sending the set configuration command. |
XBeeException | If there is any other XBee related error. |
See Also
SoftwareReset()
Performs a software reset on this XBee device and blocks until the process is completed.
Declaration
protected void SoftwareReset()
Exceptions
Type | Condition |
---|---|
InterfaceNotOpenException | If this device connection is not open. |
TimeoutException | If there is a timeout resetting the device. |
XBeeException | If there is any other XBee related error. |
ToString()
Returns the string representation of this device.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | The string representation of this device. |
Overrides
UpdateBluetoothPassword(String)
Changes the password of this Bluetooth device with the new one provided.
Declaration
public void UpdateBluetoothPassword(string newPassword)
Parameters
Type | Name | Description |
---|---|---|
System.String | newPassword | New Bluetooth password. |
Remarks
Note that your device must have Bluetooth Low Energy support to use this method.
Exceptions
Type | Condition |
---|---|
InterfaceNotOpenException | If this device connection is not open. |
TimeoutException | If there is a timeout changing the Bluetooth password. |
XBeeException | If there is any other XBee related error. |
WriteChanges()
Writes configurable parameter values to the non-volatile memory of this XBee device so that parameter modifications persist through subsequent resets.
Declaration
public void WriteChanges()
Remarks
Parameters values remain in this device's memory until overwritten by subsequent use of this method.
If changes are made without writing them to non-volatile memory, the module reverts back to previously saved parameters the next time the module is powered-on.
Writing the parameter modifications does not mean those values are immediately applied, this depends on the status of the 'apply configuration changes' option. Use ApplyConfigurationChangesEnabled to get its status and to enable/disable the option. If it is disabled, method ApplyChanges() can be used in order to manually apply the changes.
Exceptions
Type | Condition |
---|---|
InterfaceNotOpenException | If this device connection is not open. |
TimeoutException | If there is a timeout executing the write settings command. |
XBeeException | If there is any other XBee related error. |
See Also
Events
BluetoothDataReceived
Represents the method that will handle the Bluetooth data received event.
Declaration
protected event EventHandler<BluetoothDataReceivedEventArgs> BluetoothDataReceived
Event Type
Type | Description |
---|---|
System.EventHandler<BluetoothDataReceivedEventArgs> |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If the event handler is |
See Also
DataReceived
Represents the method that will handle the Data received event.
Declaration
protected event EventHandler<DataReceivedEventArgs> DataReceived
Event Type
Type | Description |
---|---|
System.EventHandler<DataReceivedEventArgs> |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If the event handler is |
See Also
ExplicitDataReceived
Represents the method that will handle the explicit data received event.
Declaration
protected event EventHandler<ExplicitDataReceivedEventArgs> ExplicitDataReceived
Event Type
Type | Description |
---|---|
System.EventHandler<ExplicitDataReceivedEventArgs> |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If the event handler is |
See Also
IOSampleReceived
Represents the method that will handle the IO Sample received event.
Declaration
protected event EventHandler<IOSampleReceivedEventArgs> IOSampleReceived
Event Type
Type | Description |
---|---|
System.EventHandler<IOSampleReceivedEventArgs> |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If the event handler is |
See Also
IPDataReceived
Represents the method that will handle the IP data received event.
Declaration
protected event EventHandler<IPDataReceivedEventArgs> IPDataReceived
Event Type
Type | Description |
---|---|
System.EventHandler<IPDataReceivedEventArgs> |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If the event handler is |
See Also
MicroPythonDataReceived
Represents the method that will handle the MicroPython data received event.
Declaration
protected event EventHandler<MicroPythonDataReceivedEventArgs> MicroPythonDataReceived
Event Type
Type | Description |
---|---|
System.EventHandler<MicroPythonDataReceivedEventArgs> |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If the event handler is |
See Also
ModemStatusReceived
Represents the method that will handle the Modem status received event.
Declaration
protected event EventHandler<ModemStatusReceivedEventArgs> ModemStatusReceived
Event Type
Type | Description |
---|---|
System.EventHandler<ModemStatusReceivedEventArgs> |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If the event handler is |
See Also
PacketReceived
Represents the method that will handle the Packet received event.
Declaration
protected event EventHandler<PacketReceivedEventArgs> PacketReceived
Event Type
Type | Description |
---|---|
System.EventHandler<PacketReceivedEventArgs> |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If the event handler is |
See Also
SerialDataReceived
Represents the method that will handle the serial data received event.
Declaration
protected event EventHandler<SerialDataReceivedEventArgs> SerialDataReceived
Event Type
Type | Description |
---|---|
System.EventHandler<SerialDataReceivedEventArgs> |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If the event handler is |
See Also
SMSReceived
Represents the method that will handle the SMS received event.
Declaration
protected event EventHandler<SMSReceivedEventArgs> SMSReceived
Event Type
Type | Description |
---|---|
System.EventHandler<SMSReceivedEventArgs> |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If the event handler is |
See Also
UserDataRelayReceived
Represents the method that will handle the User Data Relay received event.
Declaration
protected event EventHandler<UserDataRelayReceivedEventArgs> UserDataRelayReceived
Event Type
Type | Description |
---|---|
System.EventHandler<UserDataRelayReceivedEventArgs> |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | If the event handler is |