WirelessNodeConfig
WirelessNodeConfig

Class used for setting the configuration of WirelessNode objects.  Set all the configuration values that you want to change, then verify and apply them to a Node.

See also: WirelessNode::applyConfig

Functions
WirelessNodeConfig
WirelessNodeConfig()

Creates a blank WirelessNodeConfig.

Variables
m_defaultMode
boost::optional<WirelessTypes::DefaultMode> m_defaultMode

The WirelessTypes::DefaultMode to set.

m_inactivityTimeout
boost::optional<uint16> m_inactivityTimeout

The inactivity timeout to set.

m_checkRadioInterval
boost::optional<uint8> m_checkRadioInterval

The check radio interval to set.

m_transmitPower
boost::optional<WirelessTypes::TransmitPower> m_transmitPower

The WirelessTypes::TransmitPower to set.

m_samplingMode
boost::optional<WirelessTypes::SamplingMode> m_samplingMode

The WirelessTypes::SamplingMode to set.

m_sampleRate
boost::optional<WirelessTypes::WirelessSampleRate> m_sampleRate

The WirelessTypes::WirelessSampleRate to set.

m_activeChannels
boost::optional<ChannelMask> m_activeChannels

The ChannelMask to set.

m_numSweeps
boost::optional<uint32> m_numSweeps

The numbers of sweeps to set.

m_unlimitedDuration
boost::optional<bool> m_unlimitedDuration

The unlimited duration flag to set.

m_dataFormat
boost::optional<WirelessTypes::DataFormat> m_dataFormat

The WirelessTypes::DataFormat to set.

m_dataCollectionMethod
boost::optional<WirelessTypes::DataCollectionMethod> m_dataCollectionMethod

The WirelessTypes::DataCollectionMethod to set.

m_timeBetweenBursts
boost::optional<TimeSpan> m_timeBetweenBursts

The amount of time between each burst to set.

m_lostBeaconTimeout
boost::optional<uint16> m_lostBeaconTimeout

The lost beacon timeout to set.

m_fatigueOptions
boost::optional<FatigueOptions> m_fatigueOptions

The FatigueOptions to set.

m_histogramOptions
boost::optional<HistogramOptions> m_histogramOptions

The HistogramOptions to set.

m_activitySense
boost::optional<ActivitySense> m_activitySense

The ActivitySense to set.

m_hardwareGains
std::map<ChannelMask, double> m_hardwareGains

The map of ChannelMask to hardware gains to set.

m_hardwareOffsets
std::map<ChannelMask, uint16> m_hardwareOffsets

The map of ChannelMask to hardware offsets to set.

m_gaugeFactors
std::map<ChannelMask, float> m_gaugeFactors

The map of ChannelMask to gauge factors to set.

m_settlingTimes
std::map<ChannelMask, WirelessTypes::SettlingTime> m_settlingTimes

The map of ChannelMask to WirelessTypes::SettlingTime to set.

m_thermoTypes
std::map<ChannelMask, WirelessTypes::ThermocoupleType> m_thermoTypes

The map of ChannelMask to WirelessTypes::ThermocoupleType to set.

m_linearEquations
std::map<ChannelMask, LinearEquation> m_linearEquations

The map of ChannelMask to LinearEquation to set.

m_units
std::map<ChannelMask, WirelessTypes::CalCoef_Unit> m_units

The map of ChannelMask to WirelessTypes::CalCoef_Unit to set.

m_equationTypes
std::map<ChannelMask, WirelessTypes::CalCoef_EquationType> m_equationTypes

The map of ChannelMask to WirelessTypes::CalCoef_EquationType to set.

Functions
curSamplingMode
WirelessTypes::SamplingMode curSamplingMode(
const NodeEepromHelper &eeprom
) const

Gets the sampling mode currently set, or from the node if not set.

curSampleRate
WirelessTypes::WirelessSampleRate curSampleRate(
const NodeEepromHelper &eeprom
) const

Gets the sample rate currently set, or from the node if not set.

curActiveChs
ChannelMask curActiveChs(
const NodeEepromHelper &eeprom
) const

Gets the active channels currently set, or from the node if not set.

curNumSweeps
uint32 curNumSweeps(
const NodeEepromHelper &eeprom
) const

Gets the number of sweeps currently set, or from the node if not set.

curUnlimitedDuration
bool curUnlimitedDuration(
const NodeEepromHelper &eeprom
) const

Gets the unlimited duration flag currently set, or from the node if not set.

curDataFormat
WirelessTypes::DataFormat curDataFormat(
const NodeEepromHelper &eeprom
) const

Gets the data format currently set, or from the node if not set.

curTimeBetweenBursts
TimeSpan curTimeBetweenBursts(
const NodeEepromHelper &eeprom
) const

Gets the time between bursts currently set, or from the node if not set.

curSettlingTime
WirelessTypes::SettlingTime curSettlingTime(
const ChannelMask &mask,
const NodeEepromHelper &eeprom
) const

Gets the filter settling time currently set for the given ChannelMask, or from the node if not set.

checkValue
template<typename T> void checkValue(
const boost::optional<T> &opt,
const std::string &valueName
) const

Throws an exception if an optional value isn't set.

Parameters
opt
const boost::optional<T>&

The boost::optional value to check if it is set.

valueName
const std::string&

The name of the value being checked. This will be included in the exception description if not set.

Exceptions
Error_NoData

The requested value has not been set.

isSet
template<typename T> bool isSet(
const boost::optional<T> &opt
) const

Checks whether the optional value is set.

Parameters
opt
const boost::optional<T>&

The boost::optional value to check if it is set.

Returns

true if the value is set, false if it is not set.

isSet
template<typename T> bool isSet(
const std::map<ChannelMask, T> &map,
const ChannelMask &mask
) const

Checks whether a value is set in the ChannelMask option map for the given ChannelMask.

Parameters
val

The map to check if any values are set within.

Returns

true if the map contains at least 1 setting, false if it is empty.

isAnySet
template<typename T> bool isAnySet(
const std::map<ChannelMask, T> &map
) const

Checks whether there are any values set in the ChannelMask option map.

Parameters
map
const std::map<ChannelMask, T>&

The map to check if any values are set within.

Returns

true if the map contains at least 1 setting, false if it is empty.

getChannelMapVal
template<typename T> const T& getChannelMapVal(
const std::map<ChannelMask, T> &map,
const ChannelMask &mask,
const std::string &valueName
) const

Returns the value in the given map for the provided channel mask, and throws an exception if not found.

Parameters
map
const std::map<ChannelMask, T>&

The map of ChannelMask to T value to search in.

mask

The ChannelMask to look for.

valueName
const std::string&

The name of the value being checked. This will be included in the exception description if not set.

Returns

The value found for the ChannelMask in the provided map.

Exceptions
Error_NoData

The requested value has not been set for the provided ChannelMask.

setChannelMapVal
template<typename T> void setChannelMapVal(
std::map<ChannelMask, T> &map,
const ChannelMask &mask,
value
)

Sets the value in the given map for the provided channel mask.  This will update it if it already exists, and add an item to the map if it does not.

Parameters
map
std::map<ChannelMask, T>&

The map of ChannelMask to T value to add the value to.

mask

The ChannelMask to set the value for.

value
T

The value to set in the map.

verifySupported
bool verifySupported(
const NodeFeatures &features,
const NodeEepromHelper &eeprom,
ConfigIssues &outIssues
) const

Checks whether all the configuration values are supported by the node.

Parameters
features

The NodeFeatures of the WirelessNode to verify the configuration for.

eeprom

The NodeEepromHelper of the WirelessNode to use for communication.

outIssues
ConfigIssues&

The ConfigIssues holding any resulting issues that are found with the configuration. Must be empty when calling.

Returns

true if no issues were found, false otherwise. If false, the outIssues parameter will hold all issues that were found.

verifyConflicts
bool verifyConflicts(
const NodeFeatures &features,
const NodeEepromHelper &eeprom,
ConfigIssues &outIssues
) const

Checks whether configuration values conflict with each other.  If any of the config values that need to be checked aren't currently set, they will be read from the Node for verification.

Parameters
features

The NodeFeatures of the WirelessNode to verify the configuration for.

eeprom

The NodeEepromHelper of the WirelessNode to use for communication.

outIssues
ConfigIssues&

The ConfigIssues holding any resulting issues that are found with the configuration. Must be empty when calling.

Returns

true if no issues were found, false otherwise. If false, the outIssues parameter will hold all issues that were found.

apply
void apply(
const NodeFeatures &features,
NodeEepromHelper &eeprom
) const

Writes all of the configuration values that are set to a WirelessNode.

Parameters
features

The NodeFeatures of the WirelessNode to write the config to.

eeprom

The NodeEepromHelper of the WirelessNode to write the config to.

Exceptions
verify
bool verify(
const NodeFeatures &features,
const NodeEepromHelper &eeprom,
ConfigIssues &outIssues
) const

Checks whether the current settings are ok to be written to a given WirelessNode.

Parameters
features

The NodeFeatures of the WirelessNode to verify the configuration for.

eeprom

The NodeEepromHelper of the WirelessNode to use for communication.

outIssues
ConfigIssues&

The ConfigIssues holding any resulting issues that are found with the configuration.

Returns

true if the configuration is valid. false if the configuration is invalid and outIssues should be checked for more information.

Exceptions
defaultMode
WirelessTypes::DefaultMode defaultMode() const

Gets the WirelessTypes::DefaultMode value in the Config, if set.

Exceptions
Error_NoData

The requested value has not been set.

defaultMode
void defaultMode(
WirelessTypes::DefaultMode mode
)

Sets the WirelessTypes::DefaultMode value in the Config.

inactivityTimeout
uint16 inactivityTimeout() const

Gets the user inactivity timeout value in the Config, if set.

Exceptions
Error_NoData

The requested value has not been set.

inactivityTimeout
void inactivityTimeout(
uint16 timeout
)

Sets the user inactivity timeout value in the Config.  This controls how many seconds before the Node goes to sleep when idle. (min of 5 seconds) Note: A value of 65535 (0xFFFF) disables the inactivity timeout so that the Node never goes to sleep.

checkRadioInterval
uint8 checkRadioInterval() const

Gets the check radio interval value in the Config, if set.

Exceptions
Error_NoData

The requested value has not been set.

checkRadioInterval
void checkRadioInterval(
uint8 interval
)

Sets the check radio interval value (in seconds) in the Config.  This controls how often the Node wakes up from sleep to check for commands.

transmitPower
WirelessTypes::TransmitPower transmitPower() const

Gets the WirelessTypes::TransmitPower value in the Config, if set.

Exceptions
Error_NoData

The requested value has not been set.

transmitPower
void transmitPower(
WirelessTypes::TransmitPower power
)

Sets the WirelessTypes::TransmitPower value in the Config.

samplingMode
WirelessTypes::SamplingMode samplingMode() const

Gets the WirelessTypes::SamplingMode value in the Config, if set.

Exceptions
Error_NoData

The requested value has not been set.

samplingMode
void samplingMode(
WirelessTypes::SamplingMode mode
)

Sets the WirelessTypes::SamplingMode value in the Config.

sampleRate
WirelessTypes::WirelessSampleRate sampleRate() const

Gets the WirelessTypes::WirelessSampleRate value in the Config, if set.

Exceptions
Error_NoData

The requested value has not been set.

sampleRate
void sampleRate(
WirelessTypes::WirelessSampleRate rate
)

Sets the WirelessTypes::WirelessSampleRate value in the Config.

activeChannels
ChannelMask activeChannels() const

Gets the ChannelMask value in the Config, if set.

Exceptions
Error_NoData

The requested value has not been set.

activeChannels
void activeChannels(
ChannelMask channels
)

Sets the ChannelMask value in the Config.

numSweeps
uint32 numSweeps() const

Gets the number of sweeps value in the Config, if set.

Exceptions
Error_NoData

The requested value has not been set.

numSweeps
void numSweeps(
uint32 sweeps
)

Sets the number of sweeps value in the Config.  This affects the duration of sampling if unlimited duration is disabled, or the duration of each burst if the sampling mode is Sync Sampling Burst.  Note: The number of sweeps should be normalized before it is set, using NodeFeatures::normalizeNumSweeps.

unlimitedDuration
bool unlimitedDuration() const

Gets the value of the unlimited duration flag in the Config, if set.

Exceptions
Error_NoData

The requested value has not been set.

unlimitedDuration
void unlimitedDuration(
bool enable
)

Sets the value of the unlimited duration flag in the Config.

dataFormat
WirelessTypes::DataFormat dataFormat() const

Gets the WirelessTypes::DataFormat value in the Config, if set.

Exceptions
Error_NoData

The requested value has not been set.

dataFormat
void dataFormat(
WirelessTypes::DataFormat format
)

Sets the WirelessTypes::DataFormat in the Config.

dataCollectionMethod
WirelessTypes::DataCollectionMethod dataCollectionMethod() const

Gets the WirelessTypes::DataCollectionMethod value in the Config, if set.

Exceptions
Error_NoData

The requested value has not been set.

dataCollectionMethod
void dataCollectionMethod(
WirelessTypes::DataCollectionMethod method
)

Sets the WirelessTypes::DataCollectionMethod in the Config, representing how the data will be collected.  Note: this has no affect if the sampling mode is Armed Datalogging, as this mode only operates in "log only".

timeBetweenBursts
TimeSpan timeBetweenBursts() const

Gets the amount of time between each burst value in the Config, if set.

Exceptions
Error_NoData

The requested value has not been set.

timeBetweenBursts
void timeBetweenBursts(
const TimeSpan &time
)

Sets the amount of time between each burst in the Config.  Note: This value should be normalized before it is set, using NodeFeatures::normalizeTimeBetweenBursts.

lostBeaconTimeout
uint16 lostBeaconTimeout() const

Gets the lost beacon timeout in the Config, if set.

Exceptions
Error_NoData

The requested value has not been set.

lostBeaconTimeout
void lostBeaconTimeout(
uint16 minutes
)

Sets the lost beacon timeout in the Config.  Note: This value should be within NodeFeatures::minLostBeaconTimeout and NodeFeatures::maxLostBeaconTimeout.  Note: A value of 0 disables the lost beacon timeout.

hardwareGain
double hardwareGain(
const ChannelMask &mask
) const

Gets the hardware gain for the given ChannelMask in the Config, if set.

Parameters
mask

The ChannelMask to set the hardware gain for.

Exceptions
Error_NoData

The requested value has not been set.

hardwareGain
void hardwareGain(
const ChannelMask &mask,
double gain
)

Sets the hardware gain for the given ChannelMask in the Config.  Note: This value should be normalized before it is set, using NodeFeatures::normalizeHardwareGain.

hardwareOffset
uint16 hardwareOffset(
const ChannelMask &mask
) const

Gets the hardware offset for the given ChannelMask in the Config, if set.

Parameters
mask

The ChannelMask to set the hardware offset for.

Exceptions
Error_NoData

The requested value has not been set.

hardwareOffset
void hardwareOffset(
const ChannelMask &mask,
uint16 offset
)

Sets the hardware offset for the given ChannelMask in the Config.

gaugeFactor
float gaugeFactor(
const ChannelMask &mask
) const

Gets the gauge factor for the given ChannelMask in the Config, if set.

Parameters
mask

The ChannelMask to set the gauge factor for.

Exceptions
Error_NoData

The requested value has not been set.

gaugeFactor
void gaugeFactor(
const ChannelMask &mask,
float factor
)

Sets the gauge Factor for the given ChannelMask in the Config.

linearEquation
const LinearEquation& linearEquation(
const ChannelMask &mask
) const

Gets the LinearEquation for the given ChannelMask in the Config, if set.

Parameters
mask

The ChannelMask to set the linear equation for.

Exceptions
Error_NoData

The requested value has not been set.

linearEquation
void linearEquation(
const ChannelMask &mask,
const LinearEquation &linearEquation
)

Sets the LinearEquation for the given ChannelMask in the Config.

unit
WirelessTypes::CalCoef_Unit unit(
const ChannelMask &mask
) const

Gets the WirelessTypes::CalCoef_Unit for the given ChannelMask in the Config, if set.

Parameters
mask

The ChannelMask to set the linear equation for.

Exceptions
Error_NoData

The requested value has not been set.

unit
void unit(
const ChannelMask &mask,
WirelessTypes::CalCoef_Unit unit
)

Sets the WirelessTypes::CalCoef_Unit for the given ChannelMask in the Config.

equationType
WirelessTypes::CalCoef_EquationType equationType(
const ChannelMask &mask
) const

Gets the WirelessTypes::CalCoef_EquationType for the given ChannelMask in the Config, if set.

Parameters
mask

The ChannelMask to set the linear equation for.

Exceptions
Error_NoData

The requested value has not been set.

equationType
void equationType(
const ChannelMask &mask,
WirelessTypes::CalCoef_EquationType equation
)

Sets the WirelessTypes::CalCoef_EquationType for the given ChannelMask in the Config.

filterSettlingTime
WirelessTypes::SettlingTime filterSettlingTime(
const ChannelMask &mask
) const

Gets the WirelessTypes::SettlingTime for the given ChannelMask in the Config, if set.

Parameters
mask

The ChannelMask to set the filter settling time for.

Exceptions
Error_NoData

The requested value has not been set.

filterSettlingTime
void filterSettlingTime(
const ChannelMask &mask,
WirelessTypes::SettlingTime settlingTime
)

Sets the WirelessTypes::SettlingTime for the given ChannelMask in the Config.

thermocoupleType
WirelessTypes::ThermocoupleType thermocoupleType(
const ChannelMask &mask
) const

Gets the WirelessTypes::ThermocoupleType for the given ChannelMask in the Config, if set.

Parameters
mask

The ChannelMask to set the thermocouple type for.

Exceptions
Error_NoData

The requested value has not been set.

thermocoupleType
void thermocoupleType(
const ChannelMask &mask,
WirelessTypes::ThermocoupleType type
)

Sets the WirelessTypes::ThermocoupleType for the given ChannelMask in the Config.

fatigueOptions
const FatigueOptions& fatigueOptions() const

Gets the FatigueOptions currently set in the Config.

Exceptions
Error_NoData

The requested value has not been set.

fatigueOptions
void fatigueOptions(
const FatigueOptions &fatigueOpts
)

Sets the FatigueOptions in the Config.

histogramOptions
const HistogramOptions& histogramOptions() const

Gets the HistogramOptions currently set in the Config.

Exceptions
Error_NoData

The requested value has not been set.

histogramOptions
void histogramOptions(
const HistogramOptions &histogramOpts
)

Sets the HistogramOptions in the Config.

activitySense
const ActivitySense& activitySense() const

Gets the ActivitySense currently set in the Config.

Exceptions
Error_NoData

The requested value has not been set.

activitySense
void activitySense(
const ActivitySense &activitySenseOpts
)

Sets the ActivitySense in the Config.