XBee C# library API reference

Show / Hide Table of Contents

Class CellularDevice

This class represents a local Cellular device.

Inheritance
System.Object
AbstractXBeeDevice
IPDevice
CellularDevice
Inherited Members
IPDevice.DEFAULT_SOURCE_PORT
IPDevice.DEFAULT_PROTOCOL
IPDevice.ipAddress
IPDevice.sourcePort
IPDevice.PacketReceived
IPDevice.ModemStatusReceived
IPDevice.UserDataRelayReceived
IPDevice.BluetoothDataReceived
IPDevice.MicroPythonDataReceived
IPDevice.IPDataReceived
IPDevice.IPAddress
IPDevice.XBee16BitAddr
IPDevice.OperatingMode
IPDevice.IsOpen
IPDevice.IsRemote
IPDevice.ReceiveTimeout
IPDevice.Close()
IPDevice.GetDestinationIPAddress()
IPDevice.SetDestinationIPAddress(IPAddress)
IPDevice.GetNextFrameID()
IPDevice.SendUserDataRelay(XBeeLocalInterface, Byte[])
IPDevice.SendBluetoothData(Byte[])
IPDevice.SendMicroPythonData(Byte[])
IPDevice.SendPacket(XBeePacket, EventHandler<PacketReceivedEventArgs>)
IPDevice.SendPacketAsync(XBeePacket)
IPDevice.SendPacket(XBeePacket)
IPDevice.Reset()
IPDevice.ReadUserDataRelay()
IPDevice.ReadUserDataRelay(Int32)
IPDevice.StartListening(Int32)
IPDevice.StopListening()
IPDevice.SendIPData(IPAddress, Int32, IPProtocol, Boolean, Byte[])
IPDevice.SendIPData(IPAddress, Int32, IPProtocol, Byte[])
IPDevice.SendIPDataAsync(IPAddress, Int32, IPProtocol, Boolean, Byte[])
IPDevice.SendIPDataAsync(IPAddress, Int32, IPProtocol, Byte[])
IPDevice.SendBroadcastIPData(Int32, Byte[])
IPDevice.ReadIPData()
IPDevice.ReadIPData(Int32)
IPDevice.ReadIPDataFrom(IPAddress)
IPDevice.ReadIPDataFrom(IPAddress, Int32)
AbstractXBeeDevice.DEFAULT_RECEIVE_TIMETOUT
AbstractXBeeDevice.TIMEOUT_BEFORE_COMMAND_MODE
AbstractXBeeDevice.TIMEOUT_ENTER_COMMAND_MODE
AbstractXBeeDevice.PARAMETER_NODE_ID
AbstractXBeeDevice.TIMEOUT_READ_PACKET
AbstractXBeeDevice.dataReader
AbstractXBeeDevice.currentFrameID
AbstractXBeeDevice.receiveTimeout
AbstractXBeeDevice.localXBeeDevice
AbstractXBeeDevice.logger
AbstractXBeeDevice.bluetoothPassword
AbstractXBeeDevice.network
AbstractXBeeDevice.DataReceived
AbstractXBeeDevice.IOSampleReceived
AbstractXBeeDevice.ExplicitDataReceived
AbstractXBeeDevice.SerialDataReceived
AbstractXBeeDevice.FirmwareVersion
AbstractXBeeDevice.HardwareVersion
AbstractXBeeDevice.HardwareVersionString
AbstractXBeeDevice.SignalStrength
AbstractXBeeDevice.ApplyConfigurationChangesEnabled
AbstractXBeeDevice.IsInitialized
AbstractXBeeDevice.ConnectionInterface
AbstractXBeeDevice.APIOutputMode
AbstractXBeeDevice.SetIOConfiguration(IOLine, IOMode)
AbstractXBeeDevice.GetIOConfiguration(IOLine)
AbstractXBeeDevice.SetDIOValue(IOLine, IOValue)
AbstractXBeeDevice.GetDIOValue(IOLine)
AbstractXBeeDevice.SetPWMDutyCycle(IOLine, Double)
AbstractXBeeDevice.GetPWMDutyCycle(IOLine)
AbstractXBeeDevice.GetADCValue(IOLine)
AbstractXBeeDevice.SetDestinationAddress(XBee64BitAddress)
AbstractXBeeDevice.GetDestinationAddress()
AbstractXBeeDevice.SetIOSamplingRate(Int32)
AbstractXBeeDevice.GetIOSamplingRate()
AbstractXBeeDevice.SetDIOChangeDetection(ISet<IOLine>)
AbstractXBeeDevice.GetDIOChangeDetection()
AbstractXBeeDevice.ApplyChanges()
AbstractXBeeDevice.ReadIOSample()
AbstractXBeeDevice.SetParameter(String, Byte[])
AbstractXBeeDevice.GetParameter(String)
AbstractXBeeDevice.ExecuteParameter(String)
AbstractXBeeDevice.SoftwareReset()
AbstractXBeeDevice.ToString()
AbstractXBeeDevice.SetNodeID(String)
AbstractXBeeDevice.GetPANID()
AbstractXBeeDevice.SetPANID(Byte[])
AbstractXBeeDevice.GetPowerLevel()
AbstractXBeeDevice.SetPowerLevel(PowerLevel)
AbstractXBeeDevice.WriteChanges()
AbstractXBeeDevice.EnableBluetooth()
AbstractXBeeDevice.DisableBluetooth()
AbstractXBeeDevice.GetBluetoothMacAddress()
AbstractXBeeDevice.UpdateBluetoothPassword(String)
AbstractXBeeDevice.GetAddressString()
AbstractXBeeDevice.SendATCommand(ATCommand)
AbstractXBeeDevice.SendXBeePacketAsync(XBeePacket)
AbstractXBeeDevice.SendXBeePacket(XBeePacket, EventHandler<PacketReceivedEventArgs>)
AbstractXBeeDevice.SendXBeePacket(XBeePacket)
AbstractXBeeDevice.SendAndCheckXBeePacket(XBeePacket, Boolean)
AbstractXBeeDevice.CheckATCommandResponseIsValid(ATCommandResponse)
AbstractXBeeDevice.GetAssociationIndicationStatus()
AbstractXBeeDevice.ForceDisassociate()
AbstractXBeeDevice.SendSerialData(Byte[])
AbstractXBeeDevice.DetermineOperatingMode()
AbstractXBeeDevice.GetNetwork()
AbstractXBeeDevice.SendDataAsync(RemoteXBeeDevice, Byte[])
AbstractXBeeDevice.SendData(RemoteXBeeDevice, Byte[])
AbstractXBeeDevice.SendBroadcastData(Byte[])
AbstractXBeeDevice.ReadData()
AbstractXBeeDevice.ReadData(Int32)
AbstractXBeeDevice.ReadDataFrom(RemoteXBeeDevice)
AbstractXBeeDevice.ReadDataFrom(RemoteXBeeDevice, Int32)
AbstractXBeeDevice.ReadExplicitData()
AbstractXBeeDevice.ReadExplicitData(Int32)
AbstractXBeeDevice.ReadExplicitDataFrom(RemoteXBeeDevice)
AbstractXBeeDevice.ReadExplicitDataFrom(RemoteXBeeDevice, Int32)
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[])
AbstractXBeeDevice.SetBluetoothPassword(String)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: XBeeLibrary.Core
Assembly: XBeeLibrary.Core.dll
Syntax
public class CellularDevice : IPDevice

Constructors

CellularDevice(IConnectionInterface)

Class constructor. Instantiates a new CellularDevice object with the given connection interface.

Declaration
public CellularDevice(IConnectionInterface connectionInterface)
Parameters
Type Name Description
IConnectionInterface connectionInterface

The connection interface with the physical Cellular device.

Exceptions
Type Condition
System.ArgumentNullException

If connectionInterface == null.

See Also
XBeeDevice(IConnectionInterface)
IConnectionInterface

Properties

IMEIAddress

The IMEI address for this Cellular device.

Declaration
public XBeeIMEIAddress IMEIAddress { get; }
Property Value
Type Description
XBeeIMEIAddress
See Also
XBeeIMEIAddress

NodeID

The node identifier of this XBee device. This is not supported in Cellular devices, so it always returns null.

Declaration
public override string NodeID { get; }
Property Value
Type Description
System.String
Overrides
AbstractXBeeDevice.NodeID
See Also
XBee64BitAddress

XBee64BitAddr

The 64-bit address of this XBee device. This is not supported in Cellular devices, so it always returns null.

Declaration
public override XBee64BitAddress XBee64BitAddr { get; }
Property Value
Type Description
XBee64BitAddress
Overrides
AbstractXBeeDevice.XBee64BitAddr
See Also
XBee64BitAddress

XBeeProtocol

The protocol of the XBee device.

Declaration
public override XBeeProtocol XBeeProtocol { get; }
Property Value
Type Description
XBeeProtocol
Overrides
AbstractXBeeDevice.XBeeProtocol
See Also
CELLULAR

Methods

GetCellularAssociationIndicationStatus()

Returns the current association status of this Cellular device.

Declaration
public CellularAssociationIndicationStatus GetCellularAssociationIndicationStatus()
Returns
Type Description
CellularAssociationIndicationStatus

The current CellularAssociationIndicationStatus of the device.

Remarks

It indicates occurrences of errors during the modem initialization and connection.

Exceptions
Type Condition
InterfaceNotOpenException

If this device connection is not open.

TimeoutException

If there is a timeout reading the cellular association indication status.

XBeeException

If there is any other XBee related error.

See Also
CellularAssociationIndicationStatus

IsConnected()

Indicates whether the device is connected to the Internet or not.

Declaration
public bool IsConnected()
Returns
Type Description
System.Boolean

true if the device is connected to the Internet, false otherwise.

Exceptions
Type Condition
InterfaceNotOpenException

If this device connection is not open.

TimeoutException

If there is a timeout reading the cellular association indication status.

XBeeException

If there is any other XBee related error.

Open()

Opens the connection interface associated with this XBee device.

Declaration
public override void Open()
Overrides
IPDevice.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

If the operating mode of the device is UNKNOWN or AT

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
IsOpen
Close()

ReadDeviceInfo()

Reads some parameters from this device and obtains its protocol.

Declaration
public override void ReadDeviceInfo()
Overrides
IPDevice.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.
  • IP address.
  • IMEI address.
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.

SendSMS(String, String)

Sends the provided SMS message to the given phone number.

Declaration
public void SendSMS(string phoneNumber, string data)
Parameters
Type Name Description
System.String phoneNumber

The phone number to send the SMS to.

System.String data

String containing the text of the SMS.

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 SendSMSAsync(String, String).

Exceptions
Type Condition
System.ArgumentNullException

If phoneNumber == null or if data == null.

InterfaceNotOpenException

If this device connection is not open.

OperationNotSupportedException

If the device is remote (remote devices cannot send SMS).

TimeoutException

If there is a timeout sending the given packet synchronously.

TransmitException

If the received packet is not an instance of TransmitStatusPacket or if its transmit status is different from SUCCESS.

XBeeException

If there is any other XBee related error.

See Also
ReceiveTimeout
SendSMSAsync(String, String)

SendSMSAsync(String, String)

Sends asynchronously the provided SMS to the given phone number.

Declaration
public void SendSMSAsync(string phoneNumber, string data)
Parameters
Type Name Description
System.String phoneNumber

The phone number to send the SMS to.

System.String data

String containing the text of the SMS.

Remarks

Asynchronous transmissions do not wait for answer or for transmit status packet.

Exceptions
Type Condition
System.ArgumentNullException

If phoneNumber == null or if data == null.

InterfaceNotOpenException

If this device connection is not open.

OperationNotSupportedException

If the device is remote (remote devices cannot send SMS).

XBeeException

If there is any other XBee related error.

See Also
SendSMS(String, String)

Events

SMSReceived

Represents the method that will handle the SMS received event.

Declaration
public event EventHandler<SMSReceivedEventArgs> SMSReceived
Event Type
Type Description
System.EventHandler<SMSReceivedEventArgs>
Exceptions
Type Condition
System.ArgumentNullException

If the event handler is null.

See Also
SMSReceivedEventArgs
Product page More documentation Official site About Digi Contact us Support
©2019 Digi International Inc. All rights reserved.
Digi International Inc.