Digi IoT Library for .NET MAUI API reference

Show / Hide Table of Contents

Class XBeeBLEDevice

This class represents an XBee device with Bluetooth Low Energy (BLE) connectivity.

Inheritance
object
XBeeLibrary.Core.AbstractXBeeDevice
XBeeBLEDevice
XBee802BLEDevice
XBeeCellularBLEDevice
XBeeDigiMeshBLEDevice
XBeeZigbeeBLEDevice
Inherited Members
XBeeLibrary.Core.AbstractXBeeDevice.DEFAULT_RECEIVE_TIMETOUT
XBeeLibrary.Core.AbstractXBeeDevice.TIMEOUT_BEFORE_COMMAND_MODE
XBeeLibrary.Core.AbstractXBeeDevice.TIMEOUT_ENTER_COMMAND_MODE
XBeeLibrary.Core.AbstractXBeeDevice.PARAMETER_NODE_ID
XBeeLibrary.Core.AbstractXBeeDevice.TIMEOUT_READ_PACKET
XBeeLibrary.Core.AbstractXBeeDevice.dataReader
XBeeLibrary.Core.AbstractXBeeDevice.currentFrameID
XBeeLibrary.Core.AbstractXBeeDevice.receiveTimeout
XBeeLibrary.Core.AbstractXBeeDevice.localXBeeDevice
XBeeLibrary.Core.AbstractXBeeDevice.logger
XBeeLibrary.Core.AbstractXBeeDevice.bluetoothPassword
XBeeLibrary.Core.AbstractXBeeDevice.network
XBeeLibrary.Core.AbstractXBeeDevice.ReadDeviceInfo()
XBeeLibrary.Core.AbstractXBeeDevice.SetIOConfiguration(XBeeLibrary.Core.IO.IOLine, XBeeLibrary.Core.IO.IOMode)
XBeeLibrary.Core.AbstractXBeeDevice.GetIOConfiguration(XBeeLibrary.Core.IO.IOLine)
XBeeLibrary.Core.AbstractXBeeDevice.SetDIOValue(XBeeLibrary.Core.IO.IOLine, XBeeLibrary.Core.IO.IOValue)
XBeeLibrary.Core.AbstractXBeeDevice.GetDIOValue(XBeeLibrary.Core.IO.IOLine)
AbstractXBeeDevice.SetPWMDutyCycle(IOLine, double)
XBeeLibrary.Core.AbstractXBeeDevice.GetPWMDutyCycle(XBeeLibrary.Core.IO.IOLine)
XBeeLibrary.Core.AbstractXBeeDevice.GetADCValue(XBeeLibrary.Core.IO.IOLine)
XBeeLibrary.Core.AbstractXBeeDevice.ApplyChanges()
XBeeLibrary.Core.AbstractXBeeDevice.ReadIOSample()
AbstractXBeeDevice.SetParameter(string, byte[])
AbstractXBeeDevice.GetParameter(string)
AbstractXBeeDevice.ExecuteParameter(string)
XBeeLibrary.Core.AbstractXBeeDevice.SoftwareReset()
AbstractXBeeDevice.SetNodeID(string)
XBeeLibrary.Core.AbstractXBeeDevice.WriteChanges()
XBeeLibrary.Core.AbstractXBeeDevice.EnableBluetooth()
XBeeLibrary.Core.AbstractXBeeDevice.DisableBluetooth()
XBeeLibrary.Core.AbstractXBeeDevice.GetBluetoothMacAddress()
AbstractXBeeDevice.UpdateBluetoothPassword(string)
XBeeLibrary.Core.AbstractXBeeDevice.GetAddressString()
XBeeLibrary.Core.AbstractXBeeDevice.SendATCommand(XBeeLibrary.Core.Models.ATCommand)
XBeeLibrary.Core.AbstractXBeeDevice.SendXBeePacketAsync(XBeeLibrary.Core.Packet.XBeePacket)
AbstractXBeeDevice.SendXBeePacket(XBeePacket, EventHandler<PacketReceivedEventArgs>)
XBeeLibrary.Core.AbstractXBeeDevice.SendXBeePacket(XBeeLibrary.Core.Packet.XBeePacket)
AbstractXBeeDevice.SendAndCheckXBeePacket(XBeePacket, bool)
XBeeLibrary.Core.AbstractXBeeDevice.CheckATCommandResponseIsValid(XBeeLibrary.Core.Models.ATCommandResponse)
XBeeLibrary.Core.AbstractXBeeDevice.GetAssociationIndicationStatus()
XBeeLibrary.Core.AbstractXBeeDevice.ForceDisassociate()
AbstractXBeeDevice.SendBluetoothData(byte[])
XBeeLibrary.Core.AbstractXBeeDevice.Open()
XBeeLibrary.Core.AbstractXBeeDevice.Close()
XBeeLibrary.Core.AbstractXBeeDevice.DetermineOperatingMode()
XBeeLibrary.Core.AbstractXBeeDevice.GetNetwork()
AbstractXBeeDevice.SendDataAsync(RemoteXBeeDevice, byte[])
AbstractXBeeDevice.SendData(RemoteXBeeDevice, byte[])
AbstractXBeeDevice.SendBroadcastData(byte[])
XBeeLibrary.Core.AbstractXBeeDevice.ReadDataFrom(XBeeLibrary.Core.RemoteXBeeDevice)
AbstractXBeeDevice.ReadDataFrom(RemoteXBeeDevice, int)
XBeeLibrary.Core.AbstractXBeeDevice.ReadExplicitData()
AbstractXBeeDevice.ReadExplicitData(int)
XBeeLibrary.Core.AbstractXBeeDevice.ReadExplicitDataFrom(XBeeLibrary.Core.RemoteXBeeDevice)
AbstractXBeeDevice.ReadExplicitDataFrom(RemoteXBeeDevice, int)
AbstractXBeeDevice.SendExplicitDataAsync(XBee64BitAddress, byte, byte, byte[], byte[], byte[])
AbstractXBeeDevice.SendExplicitDataAsync(XBee64BitAddress, XBee16BitAddress, byte, byte, byte[], byte[], byte[])
AbstractXBeeDevice.SendExplicitDataAsync(RemoteXBeeDevice, byte, byte, byte[], byte[], byte[])
AbstractXBeeDevice.SendExplicitData(XBee64BitAddress, byte, byte, byte[], byte[], byte[])
AbstractXBeeDevice.SendExplicitData(XBee64BitAddress, XBee16BitAddress, byte, byte, byte[], byte[], byte[])
AbstractXBeeDevice.SendExplicitData(RemoteXBeeDevice, byte, byte, byte[], byte[], byte[])
AbstractXBeeDevice.SendBroadcastExplicitData(byte, byte, byte[], byte[], byte[])
AbstractXBeeDevice.SendData(XBee64BitAddress, byte[])
AbstractXBeeDevice.SendData(XBee64BitAddress, XBee16BitAddress, byte[])
AbstractXBeeDevice.SendDataAsync(XBee64BitAddress, byte[])
AbstractXBeeDevice.SendDataAsync(XBee64BitAddress, XBee16BitAddress, byte[])
XBeeLibrary.Core.AbstractXBeeDevice.FirmwareVersion
XBeeLibrary.Core.AbstractXBeeDevice.HardwareVersion
XBeeLibrary.Core.AbstractXBeeDevice.HardwareVersionString
XBeeLibrary.Core.AbstractXBeeDevice.XBee16BitAddr
XBeeLibrary.Core.AbstractXBeeDevice.XBee64BitAddr
XBeeLibrary.Core.AbstractXBeeDevice.XBeeProtocol
XBeeLibrary.Core.AbstractXBeeDevice.SignalStrength
XBeeLibrary.Core.AbstractXBeeDevice.OperatingMode
XBeeLibrary.Core.AbstractXBeeDevice.ApplyConfigurationChangesEnabled
XBeeLibrary.Core.AbstractXBeeDevice.NodeID
XBeeLibrary.Core.AbstractXBeeDevice.IsInitialized
XBeeLibrary.Core.AbstractXBeeDevice.ConnectionInterface
XBeeLibrary.Core.AbstractXBeeDevice.IsOpen
XBeeLibrary.Core.AbstractXBeeDevice.APIOutputMode
XBeeLibrary.Core.AbstractXBeeDevice.IOSampleReceived
XBeeLibrary.Core.AbstractXBeeDevice.ModemStatusReceived
XBeeLibrary.Core.AbstractXBeeDevice.ExplicitDataReceived
XBeeLibrary.Core.AbstractXBeeDevice.BluetoothDataReceived
XBeeLibrary.Core.AbstractXBeeDevice.SMSReceived
XBeeLibrary.Core.AbstractXBeeDevice.IPDataReceived
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: DigiIoTDigiIoT.MauiDevicesXBee
Assembly: DigiIoT.Maui.dll
Syntax
public class XBeeBLEDevice : AbstractXBeeDevice

Constructors

XBeeBLEDevice(IDevice, string)

Class constructor. Instantiates a new XBeeBLEDevice object with the given parameters.

Declaration
public XBeeBLEDevice(IDevice device, string password)
Parameters
Type Name Description
IDevice device

Bluetooth device to connect to.

string password

Bluetooth password (can be null).

Remarks

The Bluetooth password must be provided before calling the Connect() method, either through this constructor or the SetBluetoothPassword(string) method.

See Also
IDevice

XBeeBLEDevice(Guid, string)

Class constructor. Instantiates a new XBeeBLEDevice object with the given parameters.

Declaration
public XBeeBLEDevice(Guid deviceGuid, string password)
Parameters
Type Name Description
Guid deviceGuid

The Bluetooth device GUID.

string password

Bluetooth password (can be null).

Remarks

The Bluetooth password must be provided before calling the Connect() method, either through this constructor or the SetBluetoothPassword(string) method.

See Also
Guid

XBeeBLEDevice(string, string)

Class constructor. Instantiates a new XBeeBLEDevice object with the given parameters.

Declaration
public XBeeBLEDevice(string deviceAddress, string password)
Parameters
Type Name Description
string deviceAddress

The address or GUID of the Bluetooth device. It must follow the format 00112233AABB or 00:11:22:33:AA:BB for the address or 01234567-0123-0123-0123-0123456789AB for the GUID.

string password

Bluetooth password (can be null).

Remarks

The Bluetooth password must be provided before calling the Connect() method, either through this constructor or the SetBluetoothPassword(string) method.

Exceptions
Type Condition
ArgumentException

If deviceAddress does not follow the format 00112233AABB or 00:11:22:33:AA:BB or 01234567-0123-0123-0123-0123456789AB.

Properties

IsConnected

The status of the Bluetooth connection. It indicates if the device is connected or not.

Declaration
public bool IsConnected { get; }
Property Value
Type Description
bool

IsRemote

Indicates whether this XBee device is a remote device.

Declaration
public override bool IsRemote { get; }
Property Value
Type Description
bool
Overrides
XBeeLibrary.Core.AbstractXBeeDevice.IsRemote

ReceiveTimeout

The XBee device timeout in milliseconds for received packets in synchronous operations.

Declaration
public int ReceiveTimeout { get; set; }
Property Value
Type Description
int
Exceptions
Type Condition
ArgumentException

If the value to be set is lesser than 0.

Methods

Connect()

Opens the Bluetooth connection with the device.

Declaration
public void Connect()

Disconnect()

Closes the Bluetooth connection with the device.

Declaration
public void Disconnect()

GetDIOChangeDetection()

Returns the set of IO lines of this device that are monitored for change detection.

Declaration
public ISet<IOLine> GetDIOChangeDetection()
Returns
Type Description
ISetXBeeLibrary.Core.IO.IOLine

Set of digital IO lines that are monitored for change detection, null if there are no monitored lines.

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
XBeeLibrary.Core.Exceptions.ATCommandEmptyException

If IC value is empty.

XBeeLibrary.Core.Exceptions.InterfaceNotOpenException

If this device connection is not open.

XBeeLibrary.Core.Exceptions.TimeoutException

If there is a timeout reading the IO change detect command.

XBeeLibrary.Core.Exceptions.XBeeException

If there is any other XBee related error.

See Also
GetDestinationAddress()
SetDestinationAddress(XBee64BitAddress)
SetDIOChangeDetection(ISet<IOLine>)
XBeeLibrary.Core.IO.IOLine

GetDestinationAddress()

Returns the 64-bit destination extended address of this XBee device.

Declaration
public XBee64BitAddress GetDestinationAddress()
Returns
Type Description
XBeeLibrary.Core.Models.XBee64BitAddress

64-bit destination address.

Remarks

XBeeLibrary.Core.Models.XBee64BitAddress.BROADCAST_ADDRESS is the broadcast address for the PAN. XBeeLibrary.Core.Models.XBee64BitAddress.COORDINATOR_ADDRESS can be used to address the Pan Coordinator.

Exceptions
Type Condition
XBeeLibrary.Core.Exceptions.ATCommandEmptyException

If DH or DL values are empty.

XBeeLibrary.Core.Exceptions.InterfaceNotOpenException

If this device connection is not open.

XBeeLibrary.Core.Exceptions.TimeoutException

If there is a timeout reading the destination address.

XBeeLibrary.Core.Exceptions.XBeeException

If there is any other XBee related error.

See Also
SetDestinationAddress(XBee64BitAddress)
XBeeLibrary.Core.Models.XBee64BitAddress

GetIOSamplingRate()

Returns the IO sampling rate of this XBee device.

Declaration
public int GetIOSamplingRate()
Returns
Type Description
int

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
XBeeLibrary.Core.Exceptions.ATCommandEmptyException

If IR value is empty.

XBeeLibrary.Core.Exceptions.InterfaceNotOpenException

If this device connection is not open.

XBeeLibrary.Core.Exceptions.TimeoutException

If there is a timeout reading the IO sampling rate command.

XBeeLibrary.Core.Exceptions.XBeeException

If there is any other XBee related error.

See Also
GetDestinationAddress()
SetDestinationAddress(XBee64BitAddress)
SetIOSamplingRate(int)

GetNextFrameID()

Gets the next Frame ID of this XBee device.

Declaration
public byte GetNextFrameID()
Returns
Type Description
byte

The next Frame ID.

GetPANID()

Returns the operating PAN ID (Personal Area Network Identifier) of this XBee device.

Declaration
public byte[] GetPANID()
Returns
Type Description
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
XBeeLibrary.Core.Exceptions.ATCommandEmptyException

If the ID command returns a null or an empty value.

XBeeLibrary.Core.Exceptions.InterfaceNotOpenException

If this device connection is not open.

XBeeLibrary.Core.Exceptions.TimeoutException

If there is a timeout reading the operating PAN ID.

XBeeLibrary.Core.Exceptions.XBeeException

If there is any other XBee related error.

See Also
SetPANID(byte[])

GetPowerLevel()

Returns the output power level at which this XBee device transmits conducted power.

Declaration
public PowerLevel GetPowerLevel()
Returns
Type Description
XBeeLibrary.Core.Models.PowerLevel

The output power level of this XBee device.

Exceptions
Type Condition
XBeeLibrary.Core.Exceptions.ATCommandEmptyException

If the PL command returns a null or an empty value.

XBeeLibrary.Core.Exceptions.InterfaceNotOpenException

If this device connection is not open.

XBeeLibrary.Core.Exceptions.TimeoutException

If there is a timeout reading the power level command.

XBeeLibrary.Core.Exceptions.XBeeException

If there is any other XBee related error.

See Also
SetPowerLevel(PowerLevel)
XBeeLibrary.Core.Models.PowerLevel

ReadData()

Reads a Bluetooth data packet received by the device during the configured receive timeout.

Declaration
public byte[] ReadData()
Returns
Type Description
byte

ReadData(int)

Reads a Bluetooth data packet received by the device during the provided timeout.

Declaration
public byte[] ReadData(int timeout)
Parameters
Type Name Description
int timeout
Returns
Type Description
byte

ReadUserDataRelay()

Reads a new User Data Relay packet received by this XBee device during the configured receive timeout.

Declaration
public UserDataRelayMessage ReadUserDataRelay()
Returns
Type Description
XBeeLibrary.Core.Models.UserDataRelayMessage

A XBeeLibrary.Core.Models.UserDataRelayMessage object containing the source interface and data. null if this device did not receive new User Data Relay during the configured receive timeout.

Remarks

This method blocks until new User Data Relay is received or the configured receive timeout expires.

Exceptions
Type Condition
XBeeLibrary.Core.Exceptions.InterfaceNotOpenException

If the interface is not open.

See Also
XBeeLibrary.Core.Models.UserDataRelayMessage

ReadUserDataRelay(int)

Reads a new User Data Relay packet received by this XBee device during the provided timeout.

Declaration
public UserDataRelayMessage ReadUserDataRelay(int timeout)
Parameters
Type Name Description
int timeout

The time to wait for new User Data Relay in milliseconds.

Returns
Type Description
XBeeLibrary.Core.Models.UserDataRelayMessage

A XBeeLibrary.Core.Models.UserDataRelayMessage object containing the source interface and data. null if this device did not receive new User Data Relay during timeout milliseconds.

Remarks

This method blocks until new User Data Relay is received or the given timeout expires.

Exceptions
Type Condition
XBeeLibrary.Core.Exceptions.InterfaceNotOpenException

If the interface is not open.

See Also
XBeeLibrary.Core.Models.UserDataRelayMessage

Reset()

Performs a software reset on this XBee device and blocks until the process is completed.

Declaration
public override void Reset()
Overrides
XBeeLibrary.Core.AbstractXBeeDevice.Reset()
Exceptions
Type Condition
XBeeLibrary.Core.Exceptions.InterfaceNotOpenException

If this device connection is not open.

XBeeLibrary.Core.Exceptions.TimeoutException

If there is a timeout resetting the device.

XBeeLibrary.Core.Exceptions.XBeeException

If there is any other XBee related error.

SendData(byte[])

Sends the given data to the device.

Declaration
public void SendData(byte[] data)
Parameters
Type Name Description
byte data

SendMicroPythonData(byte[])

Sends the given data to the XBee MicroPython interface in a User Data Relay frame.

Declaration
public void SendMicroPythonData(byte[] data)
Parameters
Type Name Description
byte data

Data to send.

Exceptions
Type Condition
ArgumentException

If data length is greater than 255 bytes.

XBeeLibrary.Core.Exceptions.XBeeException

If there is any XBee related error sending the MicroPython data.

See Also
SendSerialData(byte[])
SendUserDataRelay(XBeeLocalInterface, byte[])

SendPacket(XBeePacket)

Sends the given XBee packet synchronously and blocks until the response is received or the configured receive timeout expires.

Declaration
public XBeePacket SendPacket(XBeePacket packet)
Parameters
Type Name Description
XBeeLibrary.Core.Packet.XBeePacket packet

The XBee packet to be sent.

Returns
Type Description
XBeeLibrary.Core.Packet.XBeePacket

An XBeeLibrary.Core.Packet.XBeePacket object containing the response of the sent packet or null if there is no response.

Remarks

The receive timeout is consulted/configured using the ReceiveTimeoutproperty.

Use <xref href="DigiIoT.Maui.Devices.XBee.XBeeBLEDevice.SendPacketAsync(XBeeLibrary.Core.Packet.XBeePacket)" data-throw-if-not-resolved="false"></xref> or 
<xref href="DigiIoT.Maui.Devices.XBee.XBeeBLEDevice.SendPacket(XBeeLibrary.Core.Packet.XBeePacket%2cSystem.EventHandler%7bXBeeLibrary.Core.Events.PacketReceivedEventArgs%7d)" data-throw-if-not-resolved="false"></xref> for non-blocking 
operations.
Exceptions
Type Condition
ArgumentNullException

If packet == null.

XBeeLibrary.Core.Exceptions.InterfaceNotOpenException

If this device connection is not open.

XBeeLibrary.Core.Exceptions.InvalidOperatingModeException

If the operating mode is different from XBeeLibrary.Core.Models.OperatingMode.API and XBeeLibrary.Core.Models.OperatingMode.API_ESCAPE.

XBeeLibrary.Core.Exceptions.TimeoutException

If the configured time expires while waiting for the packet reply.

XBeeLibrary.Core.Exceptions.XBeeException

If there is any other XBee related error.

See Also
ReceiveTimeout
SendPacket(XBeePacket, EventHandler<PacketReceivedEventArgs>)
SendPacketAsync(XBeePacket)
XBeeLibrary.Core.Packet.XBeePacket

SendPacket(XBeePacket, EventHandler<PacketReceivedEventArgs>)

Sends the given XBee packet and registers the given packet handler (if not null) to manage what happens when the answers is received.

Declaration
public void SendPacket(XBeePacket packet, EventHandler<PacketReceivedEventArgs> handler)
Parameters
Type Name Description
XBeeLibrary.Core.Packet.XBeePacket packet

XBee packet to be sent.

EventHandlerXBeeLibrary.Core.Events.PacketReceivedEventArgs handler

Event handler for the operation, null not to be notified when the answer arrives.

Remarks

This is a non-blocking operation. To wait for the answer use SendPacket(XBeePacket).

Exceptions
Type Condition
ArgumentNullException

If packet == null.

XBeeLibrary.Core.Exceptions.InterfaceNotOpenException

If this device connection is not open.

XBeeLibrary.Core.Exceptions.InvalidOperatingModeException

If the operating mode is different from XBeeLibrary.Core.Models.OperatingMode.API and XBeeLibrary.Core.Models.OperatingMode.API_ESCAPE.

XBeeLibrary.Core.Exceptions.XBeeException

If there is any other XBee related error.

See Also
SendPacket(XBeePacket)
SendPacketAsync(XBeePacket)
XBeeLibrary.Core.Events.PacketReceivedEventArgs
XBeeLibrary.Core.Packet.XBeePacket

SendPacketAsync(XBeePacket)

Sends the given XBee packet asynchronously.

Declaration
public void SendPacketAsync(XBeePacket packet)
Parameters
Type Name Description
XBeeLibrary.Core.Packet.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
ArgumentNullException

If packet == null.

XBeeLibrary.Core.Exceptions.InterfaceNotOpenException

If this device connection is not open.

XBeeLibrary.Core.Exceptions.InvalidOperatingModeException

If the operating mode is different from XBeeLibrary.Core.Models.OperatingMode.API and XBeeLibrary.Core.Models.OperatingMode.API_ESCAPE.

XBeeLibrary.Core.Exceptions.XBeeException

If there is any other XBee related error.

See Also
SendPacket(XBeePacket)
SendPacket(XBeePacket, EventHandler<PacketReceivedEventArgs>)
XBeeLibrary.Core.Packet.XBeePacket

SendSerialData(byte[])

Sends the given data to the XBee serial interface in a User Data Relay frame.

Declaration
public void SendSerialData(byte[] data)
Parameters
Type Name Description
byte data

Data to send.

Exceptions
Type Condition
ArgumentException

If data length is greater than 255 bytes.

XBeeLibrary.Core.Exceptions.XBeeException

If there is any XBee related error sending the serial data.

See Also
SendMicroPythonData(byte[])
SendUserDataRelay(XBeeLocalInterface, byte[])

SendUserDataRelay(XBeeLocalInterface, byte[])

Sends the provided data to the given XBee local interface.

Declaration
public void SendUserDataRelay(XBeeLocalInterface destinationInterface, byte[] data)
Parameters
Type Name Description
XBeeLibrary.Core.Models.XBeeLocalInterface destinationInterface

Destination XBee local interface.

byte data

Data to send.

Exceptions
Type Condition
ArgumentException

If the destination interface is unknown.

ArgumentException

If data length is greater than 255 bytes.

XBeeLibrary.Core.Exceptions.XBeeException

If there is any XBee related error sending the User Data Relay.

See Also
XBeeLibrary.Core.Models.XBeeLocalInterface
SendMicroPythonData(byte[])
SendSerialData(byte[])

SetBluetoothPassword(string)

Sets the Bluetooth password of the Digi device in order to connect to it.

Declaration
public void SetBluetoothPassword(string password)
Parameters
Type Name Description
string password

SetDIOChangeDetection(ISet<IOLine>)

Sets the digital IO lines of this XBee device to be monitored and sampled whenever their status changes.

Declaration
public void SetDIOChangeDetection(ISet<IOLine> lines)
Parameters
Type Name Description
ISetXBeeLibrary.Core.IO.IOLine lines

Set of IO lines to be monitored, null to disable this feature.

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 <xref href="DigiIoT.Maui.Devices.XBee.XBeeBLEDevice.SetDestinationAddress(XBeeLibrary.Core.Models.XBee64BitAddress)" data-throw-if-not-resolved="false"></xref> 
method and retrieved by <xref href="DigiIoT.Maui.Devices.XBee.XBeeBLEDevice.GetDestinationAddress" data-throw-if-not-resolved="false"></xref>.
Exceptions
Type Condition
XBeeLibrary.Core.Exceptions.InterfaceNotOpenException

If this device connection is not open.

XBeeLibrary.Core.Exceptions.TimeoutException

If there is a timeout sending the set IO change detect command.

XBeeLibrary.Core.Exceptions.XBeeException

If there is any other XBee related error.

See Also
GetDestinationAddress()
SetDestinationAddress(XBee64BitAddress)
GetDIOChangeDetection()

SetDestinationAddress(XBee64BitAddress)

Sets the 64-bit destination extended address of this XBee device.

Declaration
public void SetDestinationAddress(XBee64BitAddress xbee64BitAddress)
Parameters
Type Name Description
XBeeLibrary.Core.Models.XBee64BitAddress xbee64BitAddress

64-bit destination address to be configured.

Remarks

XBeeLibrary.Core.Models.XBee64BitAddress.BROADCAST_ADDRESS is the broadcast address for the PAN. XBeeLibrary.Core.Models.XBee64BitAddress.COORDINATOR_ADDRESS can be used to address the Pan Coordinator.

Exceptions
Type Condition
ArgumentNullException

If xbee64BitAddress is null.

XBeeLibrary.Core.Exceptions.InterfaceNotOpenException

If this device connection is not open.

XBeeLibrary.Core.Exceptions.TimeoutException

If there is a timeout setting the destination address.

XBeeLibrary.Core.Exceptions.XBeeException

If there is any other XBee related error.

See Also
GetDestinationAddress()
XBeeLibrary.Core.Models.XBee64BitAddress

SetIOSamplingRate(int)

Sets the IO sampling rate to enable periodic sampling in this XBee device.

Declaration
public void SetIOSamplingRate(int rate)
Parameters
Type Name Description
int 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 <code class="paramref">rate</code> 
milliseconds to the configured destination address.
Exceptions
Type Condition
ArgumentException

If rate < 0 or if rate > 0xFFFF.

XBeeLibrary.Core.Exceptions.InterfaceNotOpenException

If this device connection is not open.

XBeeLibrary.Core.Exceptions.TimeoutException

If there is a timeout sending the set IO sampling rate command.

XBeeLibrary.Core.Exceptions.XBeeException

If there is any other XBee related error.

See Also
GetDestinationAddress()
SetDestinationAddress(XBee64BitAddress)
GetIOSamplingRate()

SetPANID(byte[])

Sets the PAN ID (Personal Area Network Identifier) of this XBee device.

Declaration
public void SetPANID(byte[] panID)
Parameters
Type Name Description
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
ArgumentException

If the length of panID is 0 or if panID > 8.

ArgumentNullException

If panID == null.

XBeeLibrary.Core.Exceptions.InterfaceNotOpenException

If this device connection is not open.

XBeeLibrary.Core.Exceptions.TimeoutException

If there is a timeout setting the operating PAN ID.

XBeeLibrary.Core.Exceptions.XBeeException

If there is any other XBee related error.

See Also
GetPANID()

SetPowerLevel(PowerLevel)

Sets the output power level at which this XBee device transmits conducted power.

Declaration
public void SetPowerLevel(PowerLevel powerLevel)
Parameters
Type Name Description
XBeeLibrary.Core.Models.PowerLevel powerLevel

The new output power level to be set in this XBee device.

Exceptions
Type Condition
ArgumentException

If powerLevel is XBeeLibrary.Core.Models.PowerLevel.LEVEL_UNKNOWN.

XBeeLibrary.Core.Exceptions.InterfaceNotOpenException

If this device connection is not open.

XBeeLibrary.Core.Exceptions.TimeoutException

If there is a timeout setting the power level command.

XBeeLibrary.Core.Exceptions.XBeeException

If there is any other XBee related error.

See Also
GetPowerLevel()
XBeeLibrary.Core.Models.PowerLevel

ToString()

Returns the string representation of this device.

Declaration
public override string ToString()
Returns
Type Description
string

The string representation of this device.

Overrides
XBeeLibrary.Core.AbstractXBeeDevice.ToString()

Events

DataReceived

Represents the method that will handle the Bluetooth data received event.

Declaration
public event EventHandler<DataReceivedEventArgs> DataReceived
Event Type
Type Description
EventHandlerDataReceivedEventArgs

MicroPythonDataReceived

Represents the method that will handle the MicroPython data received event.

Declaration
public event EventHandler<MicroPythonDataReceivedEventArgs> MicroPythonDataReceived
Event Type
Type Description
EventHandlerXBeeLibrary.Core.Events.Relay.MicroPythonDataReceivedEventArgs
Exceptions
Type Condition
ArgumentNullException

If the event handler is null.

See Also
XBeeLibrary.Core.Events.Relay.MicroPythonDataReceivedEventArgs

PacketReceived

Represents the method that will handle the Data received event.

Declaration
public event EventHandler<PacketReceivedEventArgs> PacketReceived
Event Type
Type Description
EventHandlerXBeeLibrary.Core.Events.PacketReceivedEventArgs
Exceptions
Type Condition
ArgumentNullException

If the event handler is null.

See Also
XBeeLibrary.Core.Events.PacketReceivedEventArgs

SerialDataReceived

Represents the method that will handle the serial data received event.

Declaration
public event EventHandler<SerialDataReceivedEventArgs> SerialDataReceived
Event Type
Type Description
EventHandlerXBeeLibrary.Core.Events.Relay.SerialDataReceivedEventArgs
Exceptions
Type Condition
ArgumentNullException

If the event handler is null.

See Also
XBeeLibrary.Core.Events.Relay.SerialDataReceivedEventArgs

UserDataRelayReceived

Represents the method that will handle the User Data Relay received event.

Declaration
public event EventHandler<UserDataRelayReceivedEventArgs> UserDataRelayReceived
Event Type
Type Description
EventHandlerXBeeLibrary.Core.Events.UserDataRelayReceivedEventArgs
Exceptions
Type Condition
ArgumentNullException

If the event handler is null.

See Also
XBeeLibrary.Core.Events.UserDataRelayReceivedEventArgs

See Also

XBeeCellularBLEDevice
XBeeDigiMeshBLEDevice
XBee802BLEDevice
XBeeZigbeeBLEDevice
Product page More documentation Official site About Digi Contact us Support
©2023, Digi International Inc. All rights reserved.
Digi International Inc.