WirelessNode_Impl
WirelessNode_Impl

Contains the implementation logic for a WirelessNode.  Most WirelessNode commands call these commands.

Functions
WirelessNode_Impl
WirelessNode_Impl(
uint16 nodeAddress,
const BaseStation &basestation
)

Creates a WirelessNode_Impl object.

Parameters
nodeAddress
uint16

the node address of the node

basestation

the node's parent Base Station

Variables
m_address
NodeAddress m_address

The address of the Node.

m_baseStation
BaseStation m_baseStation

The Node's parent BaseStation.

m_eepromSettings
NodeEepromSettings m_eepromSettings

The eeprom settings to use for the NodeEeprom object.

m_protocol
mutable std::unique_ptr<WirelessProtocol> m_protocol

The WirelessProtocol containing all of the protocol commands and info for this Node.

m_eeprom
mutable std::unique_ptr<NodeEeprom> m_eeprom

The NodeEeprom that handles reading and writing eeprom values with the Node and eeprom cache.

m_eepromHelper
mutable std::unique_ptr<NodeEepromHelper> m_eepromHelper

The NodeEepromHelper used for high level reads and writes on the Node.

m_features
mutable std::unique_ptr<NodeFeatures> m_features

The NodeFeatures containing the features for this Node.

Functions
determineProtocol
std::unique_ptr<WirelessProtocol> determineProtocol() const

Determines the WirelessProtocol to use based on the Node's firmware version.

Returns

A unique_ptr containing the WirelessProtocol to use.

eeprom
NodeEeprom& eeprom() const

Gets a reference to the NodeEeprom for this Node.

eeHelper
NodeEepromHelper& eeHelper() const

Gets a reference to the NodeEepromHelper for this Node.

features
virtual const NodeFeatures& features() const

Gets a reference to the NodeFeatures for this Node.

Exceptions
protocol
virtual const WirelessProtocol& protocol() const

Gets a reference to the WirelessProtocol for this Node.  Note: This requires communicating to the Node if creating the protocol for the first time.

Exceptions
lastCommunicationTime
const Timestamp& lastCommunicationTime() const

Gets the Timestamp for the last time MSCL communicated with the Node.

setBaseStation
void setBaseStation(
const BaseStation &basestation
)

Sets the node's parent Base Station, which will perform all communication with the Node.

Parameters
basestation

the BaseStation object to be assigned to the Node, which will perform all communication with the Node.

getBaseStation
BaseStation& getBaseStation()

Gets a reference to the BaseStation that is assigned to this Node.

hasBaseStation
bool hasBaseStation(
const BaseStation &basestation
) const

Checks whether the given BaseStation is the same BaseStation that is assigned to this Node.

Parameters
basestation

The BaseStation to check if it is the same as this Node's parent BaseStation.

Returns

true if the basestation is the same as this Node's parent BaseStation, false if it is different.

useGroupRead
void useGroupRead(
bool useGroup
)

Enables or disables the use of group eeprom read when trying to read a single value (enabled by default).

Parameters
useGroup
bool

Whether the group eeprom read commands can be used (true) or whether to restrict to single eeprom reads (false).

readWriteRetries
void readWriteRetries(
uint8 numRetries
)

Sets the number of retry attempts for reading and writing with the Node.

Parameters
numRetries
uint8

The number of retries to set for all reading and writing with the Node.

useEepromCache
void useEepromCache(
bool useCache
)

Sets whether or not to utilize the eeprom cache when configuring this Node (default of enabled).

Parameters
useCache
bool

whether the eeprom cache should be used (true) or not (false).

clearEepromCache
void clearEepromCache()

Clears the eeprom cache for this Node.

nodeAddress
uint16 nodeAddress() const

Gets the node address of the Node.

Returns

The node address of the Node.

frequency
WirelessTypes::Frequency frequency() const

Gets the WirelessTypes::Frequency that the Node is believed to be on.  If the frequency is unknown, it will be read from Eeprom.

Exceptions
firmwareVersion
virtual Version firmwareVersion() const

Gets the firmware Version of the Node.

Exceptions
model
WirelessModels::NodeModel model() const

Gets the WirelessModels::NodeModel of the Node.

Exceptions
serial
std::string serial() const

Gets the serial number of the Node.

Exceptions
microcontroller
WirelessTypes::MicroControllerType microcontroller() const

Gets the WirelessTypes::MicroControllerType of the Node.

Exceptions
radioFeatures
RadioFeatures radioFeatures() const

Gets the RadioFeatures of the Node.

Exceptions
dataStorageSize
uint64 dataStorageSize() const

Gets the number of bytes available for data storage on the Node.

Exceptions
regionCode
WirelessTypes::RegionCode regionCode() const

Gets the region code currently set on the Node.

Exceptions
verifyConfig
bool verifyConfig(
const WirelessNodeConfig &config,
ConfigIssues &outIssues
) const

Checks whether the settings in the given WirelessNodeConfig are ok to be written to the Node.  Options that are set will also be validated against each other. If an option that needs to be validated isn't currently set, it will be read from the Node.

Parameters
config

The WirelessNodeConfig to verify the configuration for.

outIssues
ConfigIssues&

The ConfigIssues that will hold 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
applyConfig
void applyConfig(
const WirelessNodeConfig &config
)

Applies a WirelessNodeConfig to the Node.

Parameters
config

The WirelessNodeConfig to apply to the Node.

Exceptions
getNumDatalogSessions
uint16 getNumDatalogSessions() const

Reads the number of datalog sessions that are currently stored on the Node.

Exceptions
getDefaultMode
WirelessTypes::DefaultMode getDefaultMode() const

Reads the WirelessTypes::DefaultMode that is currently set on the Node.

Exceptions
getInactivityTimeout
uint16 getInactivityTimeout() const

Reads the user inactivity timeout (in seconds) that is currently set on the Node.

Exceptions
getCheckRadioInterval
uint8 getCheckRadioInterval() const

Reads the check radio interval that is currently set on the Node.

Exceptions
getTransmitPower
WirelessTypes::TransmitPower getTransmitPower() const

Reads the WirelessTypes::TransmitPower that is currently set on the Node.

Exceptions
getSamplingMode
WirelessTypes::SamplingMode getSamplingMode() const

Gets the WirelessTypes::SamplingMode that is currently set on the Node.

Exceptions
getActiveChannels
ChannelMask getActiveChannels() const

Gets the ChannelMask currently set on the Node, representing which channels are enabled and disabled.

Exceptions
getSampleRate
WirelessTypes::WirelessSampleRate getSampleRate() const

Gets the WirelessTypes::WirelessSampleRate currently set on the Node.

Exceptions
getNumSweeps
uint32 getNumSweeps() const

Gets the number of sweeps currently set on the Node, which affects the duration of sampling if unlimited duration is disabled, or the duration of each burst if the sampling mode is Sync Sampling Burst.

Exceptions
getUnlimitedDuration
bool getUnlimitedDuration() const

Gets whether or not unlimited sampling duration is enabled on the Node.

Exceptions
getDataFormat
WirelessTypes::DataFormat getDataFormat() const

Gets the WirelessTypes::DataFormat that is currently set on the Node.

Exceptions
getDataCollectionMethod
WirelessTypes::DataCollectionMethod getDataCollectionMethod() const

Gets the WirelessTypes::DataCollectionMethod that is currently set on the Node, 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".

Exceptions
getTimeBetweenBursts
TimeSpan getTimeBetweenBursts() const

Gets the amount of time between each burst currently set on the Node.

Exceptions
getLostBeaconTimeout
uint16 getLostBeaconTimeout() const

Gets the lost beacon timeout, in minutes, currently set on the Node.

Exceptions
getHardwareGain
double getHardwareGain(
const ChannelMask &mask
) const

Reads the hardware gain of the specified ChannelMask.

Parameters
mask

The ChannelMask of the hardware gain to read.

Exceptions
getHardwareOffset
uint16 getHardwareOffset(
const ChannelMask &mask
) const

Reads the hardware offset of the specified ChannelMask currently set on the Node.

Parameters
mask

The ChannelMask of the hardware offset to read.

Exceptions
getGaugeFactor
float getGaugeFactor(
const ChannelMask &mask
) const

Reads the gauge factor of the specified ChannelMask currently set on the Node.

Parameters
mask

The ChannelMask of the gauge factor to read.

Returns

The gauge factor currently set on the Node for the ChannelMask.

Exceptions
getLinearEquation
LinearEquation getLinearEquation(
const ChannelMask &mask
) const

Gets the linear equation of the specified ChannelMask currently set on the Node.

Exceptions
getUnit
WirelessTypes::CalCoef_Unit getUnit(
const ChannelMask &mask
) const

Reads the unit of the specified ChannelMask currently set on the Node.

Exceptions
getEquationType
WirelessTypes::CalCoef_EquationType getEquationType(
const ChannelMask &mask
) const

Reads the WirelessTypes::CalCoef_EquationType of the specified ChannelMask currently set on the Node.

Returns

The WirelessTypes::CalCoef_EquationType currently set on the Node for this ChannelMask.

Exceptions
getFilterSettlingTime
WirelessTypes::SettlingTime getFilterSettlingTime(
const ChannelMask &mask
) const

Reads the filter settling time of the specified ChannelMask.

Parameters
mask

The ChannelMask of the filter settling time to read.

Exceptions
getThermocoupleType
WirelessTypes::ThermocoupleType getThermocoupleType(
const ChannelMask &mask
) const

Reads the WirelessTypes::ThermocoupleType of the specified ChannelMask currently set on the Node.

Parameters
mask

The ChannelMask of the thermocouple type to read.

Exceptions
getFatigueOptions
FatigueOptions getFatigueOptions() const

Reads the FatigueOptions currently set on the Node.

Exceptions
getHistogramOptions
HistogramOptions getHistogramOptions() const

Reads the HistogramOptions currently set on the Node.

Exceptions
getActivitySense
ActivitySense getActivitySense() const

Reads the ActivitySense options currently set on the Node.

Exceptions
quickPing
bool quickPing()

Performs a Quick Ping (Short Ping) command on the Node.

Returns

true if the quick ping was successful, false otherwise.

ping
virtual PingResponse ping()

Performs a Long Ping command on the Node to check the communication between the Base Station and the Node.

Returns

A PingResponse object that can be queried to get details of the ping command's response.

Exceptions
sleep
bool sleep()

Puts the Node into a low power, sleep mode.  This command attempts to ping the node before sending the sleep command, to verify communication.

Returns

true if the sleep command was successful, false otherwise.

Exceptions
cyclePower
void cyclePower()

Cycles the power on the Node.  Many configuration changes that are applied to the node do not take affect until the power is cycled.

Exceptions
resetRadio
void resetRadio()

Resets the radio on the Node.

Exceptions
changeFrequency
virtual void changeFrequency(
WirelessTypes::Frequency frequency
)

Changes the radio frequency of the Node.

Parameters
frequency

The WirelessTypes::Frequency to change the Node to.

Exceptions
setToIdle
virtual SetToIdleStatus setToIdle()

Attempts to set the Node to the Idle state so that it can be communicated with (stops it sampling, wakes it up if asleep).

Returns

A SetToIdleStatus object that can be queried to get the status of the Set to Idle operation.

Exceptions
erase
virtual void erase()

Erases all logged data on the Node.

Exceptions
startNonSyncSampling
virtual void startNonSyncSampling()

Starts the Node in Non-Synchronized Sampling Mode.

Exceptions
clearHistogram
void clearHistogram()

Clears the Histogram on the Node.

Exceptions
autoBalance
AutoBalanceResult autoBalance(
const ChannelMask &mask,
float targetPercent
)

Performs an Auto Balance command on a specified channel on the Node.

Parameters
mask

The ChannelMask to perform the auto balance command on.

targetPercent
float

The percentage (0.0 - 100.0) of the range to balance to.

Returns

The AutoBalanceResult containing information from the auto balance command.

Exceptions
autoCal_shmLink
AutoCalResult_shmLink autoCal_shmLink()

Performs automatic calibration for the SHM-Link Wireless Node.

Returns

The AutoCalResult_shmLink containing the result of the auto cal operation.

Exceptions
readEeprom
virtual uint16 readEeprom(
uint16 location
) const

Reads a uint16 from the given eeprom location of the node. This may use a page download or a read eeprom command.  If the value stored in the eeprom cache is still valid, this will be returned instead.

Parameters
location
uint16

The specific eeprom location to read from

Returns

The uint16 value read from the specified EEPROM location

Exceptions
readEeprom
virtual Value readEeprom(
const EepromLocation &location
) const

Reads a value from the given EepromLocation of the node. This may use a page download or a read eeprom command.  If the value stored in the eeprom cache is still valid, this will be returned instead.

Parameters
location

The EepromLocation to read from.

Returns

The value read from the specified EEPROM location as a Value object.

Exceptions
writeEeprom
virtual void writeEeprom(
uint16 location,
uint16 value
)

Writes a uint16 to the given eeprom location of the node.  If successful, the cache will be updated with the changed value as well.

Parameters
location
uint16

The specific eeprom location to write to

value
uint16

The uint16 value to write to the eeprom location

Exceptions
writeEeprom
virtual void writeEeprom(
const EepromLocation &location,
const Value &val
)

Writes a value to the given EepromLocation of the node.  If successful, the cache will be updated with the changed value as well.

Parameters
location

The specific EepromLocation to write to.

value

The value to write to the eeprom location, as a Value.

Exceptions