Class AbstractXBeeSetting
This class provides common functionality for all XBee settings.
Inheritance
Implements
Inherited Members
Namespace: XBeeLibrary.Core.Models
Assembly: XBeeLibrary.Core.dll
Syntax
public abstract class AbstractXBeeSetting : ICloneable
Constructors
AbstractXBeeSetting(String, String, String, String, XBeeCategory, XBeeFirmware)
Class constructor. Instantiates a new AbstractXBeeSetting object with the provided parameters.
Declaration
protected AbstractXBeeSetting(string atCommand, string name, string description, string defaultValue, XBeeCategory parentCategory, XBeeFirmware ownerFirmware)
Parameters
Type | Name | Description |
---|---|---|
System.String | atCommand | The AT command corresponding to the setting. |
System.String | name | Name of the setting. |
System.String | description | Description of the setting. |
System.String | defaultValue | Default value of the setting. |
XBeeCategory | parentCategory | Parent category of the setting. |
XBeeFirmware | ownerFirmware | XBee firmware the setting belongs to. |
AbstractXBeeSetting(String, String, String, String, XBeeCategory, XBeeFirmware, Int32)
Class constructor. Instantiates a new AbstractXBeeSetting object with the provided parameters.
Declaration
protected AbstractXBeeSetting(string atCommand, string name, string description, string defaultValue, XBeeCategory parentCategory, XBeeFirmware ownerFirmware, int numNetworks)
Parameters
Type | Name | Description |
---|---|---|
System.String | atCommand | The AT command corresponding to the setting. |
System.String | name | Name of the setting. |
System.String | description | Description of the setting. |
System.String | defaultValue | Default value of the setting. |
XBeeCategory | parentCategory | Parent category of the setting. |
XBeeFirmware | ownerFirmware | XBee firmware the setting belongs to. |
System.Int32 | numNetworks | The number of networks the setting can be configured for. |
AbstractXBeeSetting(String, String, String, XBeeCategory, XBeeFirmware)
Class constructor. Instantiates a new AbstractXBeeSetting object with the provided parameters.
Declaration
protected AbstractXBeeSetting(string name, string description, string defaultValue, XBeeCategory parentCategory, XBeeFirmware ownerFirmware)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the setting. |
System.String | description | Description of the setting. |
System.String | defaultValue | Default value of the setting. |
XBeeCategory | parentCategory | Parent category of the setting. |
XBeeFirmware | ownerFirmware | XBee firmware the setting belongs to. |
AbstractXBeeSetting(String, String, String, XBeeCategory, XBeeFirmware, Int32)
Class constructor. Instantiates a new AbstractXBeeSetting object with the provided parameters.
Declaration
protected AbstractXBeeSetting(string name, string description, string defaultValue, XBeeCategory parentCategory, XBeeFirmware ownerFirmware, int numNetworks)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the setting. |
System.String | description | Description of the setting. |
System.String | defaultValue | Default value of the setting. |
XBeeCategory | parentCategory | Parent category of the setting. |
XBeeFirmware | ownerFirmware | XBee firmware the setting belongs to. |
System.Int32 | numNetworks | The number of networks the setting can be configured for. |
Fields
COMMAND_BUFFER
Declaration
public const string COMMAND_BUFFER = "::"
Field Value
Type | Description |
---|---|
System.String |
COMMAND_BUTTON
Declaration
public const string COMMAND_BUTTON = "()"
Field Value
Type | Description |
---|---|
System.String |
TYPE_BUTTON
Declaration
public const int TYPE_BUTTON = 4
Field Value
Type | Description |
---|---|
System.Int32 |
TYPE_COMBO
Declaration
public const int TYPE_COMBO = 1
Field Value
Type | Description |
---|---|
System.Int32 |
TYPE_NO_CONTROL
Declaration
public const int TYPE_NO_CONTROL = 2
Field Value
Type | Description |
---|---|
System.Int32 |
TYPE_NUMBER
Declaration
public const int TYPE_NUMBER = 0
Field Value
Type | Description |
---|---|
System.Int32 |
TYPE_TEXT
Declaration
public const int TYPE_TEXT = 3
Field Value
Type | Description |
---|---|
System.Int32 |
Properties
AtCommand
AT command corresponding to the setting.
Declaration
public string AtCommand { get; set; }
Property Value
Type | Description |
---|---|
System.String |
CurrentValues
List of current values, 1 for each network the setting can be configured for.
Declaration
public List<string> CurrentValues { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<System.String> |
CustomDefault
Indicates whether the setting should be flashed as a custom default setting or not.
Declaration
public bool CustomDefault { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
DefaultValue
Default value of the setting.
Declaration
public string DefaultValue { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Description
Description of the setting.
Declaration
public string Description { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Enabled
Indicates whether the setting is enabled (can be edited) or not.
Declaration
public bool Enabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Name
Name of the setting.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
NumNetworks
Number of networks the setting can be configured for.
Declaration
public int NumNetworks { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
OwnerFirmware
XBee firmware the setting belongs to.
Declaration
public XBeeFirmware OwnerFirmware { get; set; }
Property Value
Type | Description |
---|---|
XBeeFirmware |
ParentCategory
Parent category of the setting.
Declaration
public XBeeCategory ParentCategory { get; set; }
Property Value
Type | Description |
---|---|
XBeeCategory |
Type
Type of setting.
Declaration
public int Type { get; protected set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
One of:
- TYPE_NUMBER
- TYPE_COMBO
- TYPE_NO_CONTROL
- TYPE_TEXT
- TYPE_BUTTON
ValidationErrorMessage
Validation error message of the setting.
Declaration
public string ValidationErrorMessage { get; protected set; }
Property Value
Type | Description |
---|---|
System.String |
Visible
Indicates whether the setting is visible or not.
Declaration
public bool Visible { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
XBeeValues
List of XBee values (values stored in the XBee device), 1 for each network the setting can be configured for.
Declaration
public List<string> XBeeValues { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<System.String> |
Methods
Clone()
Creates a shallow copy of the AbstractXBeeSetting.
Declaration
public object Clone()
Returns
Type | Description |
---|---|
System.Object | The copy of the AbstractXBeeSetting |
CloneSetting(XBeeCategory, XBeeFirmware)
Clones and returns the setting object.
Declaration
public AbstractXBeeSetting CloneSetting(XBeeCategory parentCategory, XBeeFirmware ownerFirmware)
Parameters
Type | Name | Description |
---|---|---|
XBeeCategory | parentCategory | The parent category where the cloned setting should be placed. |
XBeeFirmware | ownerFirmware | The owner firmware of the cloned setting. |
Returns
Type | Description |
---|---|
AbstractXBeeSetting | The cloned setting object. |
GetCurrentValue()
Returns the current value of the setting.
Declaration
public string GetCurrentValue()
Returns
Type | Description |
---|---|
System.String | The current value of the setting. |
GetCurrentValue(Int32)
Returns the current value of the setting for the given network index.
Declaration
public string GetCurrentValue(int networkIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | networkIndex | Network index to retrieve the setting value from. Index starts at 1. |
Returns
Type | Description |
---|---|
System.String | The current value of the setting for the given network index. |
GetLabel()
Returns the setting label to be displayed in the configuration editor.
Declaration
public string GetLabel()
Returns
Type | Description |
---|---|
System.String | The label for the setting. |
GetXBeeValue()
Returns the value of the setting that is stored in the XBee device.
Declaration
public string GetXBeeValue()
Returns
Type | Description |
---|---|
System.String | The XBee setting value. |
GetXBeeValue(Int32)
Returns the current value of the setting that is stored in the XBee device for the given network index.
Declaration
public string GetXBeeValue(int networkIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | networkIndex | Network index to retrieve the setting value from. Index starts at 1. |
Returns
Type | Description |
---|---|
System.String | The XBee setting value for the given network index. |
SetCurrentValue(String)
Sets the current value of the setting.
Declaration
public void SetCurrentValue(string currentValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | currentValue | The current value to set to the setting. |
SetCurrentValue(String, Int32)
Sets the current value of the setting for the given network index.
Declaration
public void SetCurrentValue(string currentValue, int networkIndex)
Parameters
Type | Name | Description |
---|---|---|
System.String | currentValue | The current value for the given network index. |
System.Int32 | networkIndex | Index of the network this value is for. Index starts at 1. |
SetXBeeValue(String)
Sets the value of the setting that is stored in the XBee device.
Declaration
public void SetXBeeValue(string xbeeValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | xbeeValue | The XBee setting value to set to the setting. |
SetXBeeValue(String, Int32)
Sets the value of the setting that is stored in the XBee device for the given network index.
Declaration
public void SetXBeeValue(string xbeeValue, int networkIndex)
Parameters
Type | Name | Description |
---|---|---|
System.String | xbeeValue | The XBee setting value for the given network index. |
System.Int32 | networkIndex | Index of the network this value is for. Index starts at 1. |
SupportsMultipleNetworks()
Returns whether this setting addresses multiple networks or not.
Declaration
public bool SupportsMultipleNetworks()
Returns
Type | Description |
---|---|
System.Boolean |
|
Tostring()
Returns the string representation (name) of the setting.
Declaration
public string Tostring()
Returns
Type | Description |
---|---|
System.String | The string representation (name) of the setting. |
ValidateSetting()
Returns whether or not the current value of the setting is valid.
Declaration
public abstract bool ValidateSetting()
Returns
Type | Description |
---|---|
System.Boolean |
|
ValidateSetting(Int32)
Returns whether or not the current value of the provided network index is valid.
Declaration
public abstract bool ValidateSetting(int networkIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | networkIndex |
Returns
Type | Description |
---|---|
System.Boolean |
|