Class CellularDevice
This class represents a local Cellular device.
Inherited Members
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 |
See Also
Properties
IMEIAddress
The IMEI address for this Cellular device.
Declaration
public XBeeIMEIAddress IMEIAddress { get; }
Property Value
Type | Description |
---|---|
XBeeIMEIAddress |
See Also
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
See Also
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
See Also
XBeeProtocol
The protocol of the XBee device.
Declaration
public override XBeeProtocol XBeeProtocol { get; }
Property Value
Type | Description |
---|---|
XBeeProtocol |
Overrides
See Also
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
IsConnected()
Indicates whether the device is connected to the Internet or not.
Declaration
public bool IsConnected()
Returns
Type | Description |
---|---|
System.Boolean |
|
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
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
ReadDeviceInfo()
Reads some parameters from this device and obtains its protocol.
Declaration
public override void ReadDeviceInfo()
Overrides
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 |
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
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 |
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
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 |