WirelessNode
WirelessNode

A class representing a MicroStrain wireless node

See Also

InertialNode

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

Creates a WirelessNode object

Parameters
nodeAddress
uint16

the node address of the node

base

the node's parent Base Station

~WirelessNode
virtual ~WirelessNode()

Destroys a WirelessNode object

Variables
m_impl
std::shared_ptr<WirelessNode_Impl> m_impl

The WirelessNode_Impl class that contains all the implementation logic for the WirelessNode class.

Functions
deviceName
static std::string deviceName(
uint16 nodeAddress
)

Static function for creating the universal sensor name that should be used for SensorCloud.

Parameters
nodeAddress
uint16

The node address of the wireless node. This should be identical to calling the nodeAddress function on a WirelessNode object.

Returns

The universal sensor name.

features
const NodeFeatures& features() const

Gets a reference to the NodeFeatures for this Node.  Note: This will be invalid when the WirelessNode is destroyed.

Returns

A NodeFeatures reference containing the features for this Node.

Exceptions
lastCommunicationTime
const Timestamp& lastCommunicationTime() const

Gets the Timestamp for the last time MSCL communicated with the Node.  Note: This is per BaseStation. If the parent BaseStation is changed, the last communication time will be reset.  Note: EEPROM reads using the cache, and data collection, will not update this timestamp.

Returns

A Timestamp representing the last time MSCL communicated with the Node. This will be a Timestamp of 0 if never communicated with.

setBaseStation
void setBaseStation(
const BaseStation &basestation
)

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

Parameters
base

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.

Returns

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).  Note:  In most cases, leaving this enabled will provide better performance, allowing the cache to be built quicker, requiring less communication to the actual device. However, in some cases such as with very high traffic, it may be beneficial to restrict reads to use the single commands, as the packets are smaller over the air.

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.  By default, the number of retries is 0.  Note:  The timeout that is set per command will be per read and write attempt, meaning this retry number is multiplied by the timeout for your overall timeout.

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 (enabled by default). This can be enabled/disabled at any time.  It is highly recommended to have eeprom caching be enabled.  Note:  The eeprom cache stores the last known value that was written to / read from the Node for each eeprom location. If this is enabled, any reads will get the last known value from the cache if it exists, and any writes will not write to the Node if the value attempting to be written is the same as that stored in the cache. Caching of these values will still be performed if this is disabled, however, read and write operations will then always reach out to the actual device.

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 frequency that the Node is on.

Returns

A WirelessTypes::Frequency that the Node is on.

Exceptions
firmwareVersion
Version firmwareVersion() const

Gets the firmware version of the Node.

Returns

A Version representing the firmware version of the Node.

Exceptions
model
WirelessModels::NodeModel model() const

Gets the model of the Node.

Returns

A WirelessModels::NodeModel representing the model of the Node.

Exceptions
serial
std::string serial() const

Gets the serial number of the Node.

Returns

A string representing the serial number of the Node.

Exceptions
name
std::string name() const

Gets the name of the Node. This is the universal sensor name that should be used for uploading to SensorCloud.  This is the same as calling WirelessNode::deviceName.

Returns

The universal sensor name.

microcontroller
WirelessTypes::MicroControllerType microcontroller() const

Gets the microcontroller of the Node.

Returns

A WirelessTypes::MicroControllerType representing the microcontroller of the Node.

Exceptions
radioFeatures
RadioFeatures radioFeatures() const

Gets the RadioFeatures of the Node.

Returns

The RadioFeatures of the Node.

Exceptions
dataStorageSize
uint64 dataStorageSize() const

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

Returns

The number of bytes avaialbe

Exceptions
regionCode
WirelessTypes::RegionCode regionCode() const

Gets the region code currently set on the Node.

Exceptions
quickPing
bool quickPing()

Performs a Quick Ping (Short Ping) command on the Node.  The Base Station itself responds with a quick success/fail on the Node.  Note: Use the standard ping command instead of this if you want to obtain RSSI values.

Returns

true if the quick ping was successful, false otherwise.

Exceptions
ping
PingResponse ping()

Performs a Long Ping command on the Node to check the communication between the Base Station and the Node.  The response to this command contains the Node and BaseStation RSSI values.  Note: You may want to use the quickPing command instead of this if RSSI values are not of importance.

Returns

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

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
void changeFrequency(
WirelessTypes::Frequency frequency
)

Changes the radio frequency of the Node.  Note: If successful, the Node will be put onto a different frequency than its parent base station.  It is up to the user of MSCL to switch the base station to this frequency if you wish to communicate with it.

Parameters
frequency

The WirelessTypes::Frequency to change the Node to.

Exceptions
setToIdle
SetToIdleStatus setToIdle()

Attempts to set the Node to the Idle state.  This will stop the node from sampling or sleeping, and put it into an idle state so that it may be communicated with (configured, started sampling, etc).  This command may take up to 2 minutes. The returned SetToIdleStatus object may be used to determine the current status of the Set to Idle operation.

Returns

A SetToIdleStatus object which can be used to get the current status of the ongoing Set to Idle operation, as well as cancel the operation altogether.

Exceptions
erase
void erase()

Erases all logged data on the Node.  Note: Erasing the data on the Node may take up to 30 seconds to complete for some devices.  This command will return immediately while the Node is being erased.  If you wish to check the status of the Erase operation, you can continuously ping the Node. A successful ping means the erase has completed.

Exceptions
startNonSyncSampling
void startNonSyncSampling()

Starts the Node in Non-Synchronized Sampling Mode.  This will immediately start the Node sampling, with the current Sampling settings that are applied to the Node.  Note: To start the Node in Synchronized Sampling Mode, use the SyncSamplingNetwork class.

Exceptions
clearHistogram
void clearHistogram()

Clears the Histogram on the Node.  See Also: NodeFeatures::supportsHistogramConfig

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

Performs an Auto Balance command on a specified channel on the Node.  This adjusts the sensor offset for differential channels to affect range.

See Also: getHardwareOffset, WirelessNodeConfig::hardwareOffset

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 (low = 25%, midscale = 50%, high = 75%).

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.  See Also: NodeFeatures::supportsAutoCal

Returns

The AutoCalResult_shmLink containing the result of the auto cal operation.

Exceptions
readEeprom
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.  Note: This is an advanced command. In most cases you should use the built in commands for reading a Node's configuration options.

Parameters
location
uint16

The specific eeprom location to read from

Returns

The uint16 value read from the specified EEPROM location

Exceptions
writeEeprom
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.  Note: This is an advanced command. In most cases you should use the built in commands for changing a Node's configuration options.

Parameters
location
uint16

The specific eeprom location to write to

value
uint16

The uint16 value to write to the eeprom location

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.  (ex. if sample rate is set, but sampling mode isn't, the sampling mode will be read from the Node for validating the sample rate)

Parameters
config

The WirelessNodeConfig to verify.

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.  Note: This applies all options that have been set in the WirelessNodeConfig.  Before applying, the options will be validated. It is recommended that you perform this validation yourself first by using verifyConfig.

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.

Returns

The number of datalog sessions that are stored on the Node.

Exceptions
getDefaultMode
WirelessTypes::DefaultMode getDefaultMode() const

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

Returns

The default mode that is currently set on the Node.

Exceptions
getInactivityTimeout
uint16 getInactivityTimeout() const

Reads the user inactivity timeout that is currently set on the Node.  This controls how many seconds before the Node goes to sleep when idle.

Returns

The user inactivity timeout (in seconds) that is currently set on the Node.  Note: A value of 65535 (0xFFFF) disables the inactivity timeout so that the Node never goes to sleep.

Exceptions
getCheckRadioInterval
uint8 getCheckRadioInterval() const

Reads the check radio interval that is currently set on the Node.  This controls how often the Node wakes up from sleep to check for commands.

Returns

The check radio interval (in seconds) that is currently set on the Node.

Exceptions
getTransmitPower
WirelessTypes::TransmitPower getTransmitPower() const

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

Returns

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.

Returns

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.

Returns

The ChannelMask currently set on the Node.

Exceptions
getSampleRate
WirelessTypes::WirelessSampleRate getSampleRate() const

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

Returns

A WirelessTypes::WirelessSampleRate that is 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.

Returns

The number of sweeps currently set on the Node.

Exceptions
getUnlimitedDuration
bool getUnlimitedDuration() const

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

Returns

true if unlimited sampling duration is enabled on the Node, false if it is disabled.

Exceptions
getDataFormat
WirelessTypes::DataFormat getDataFormat() const

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

Returns

The WirelessTypes::DataFormat 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".

Returns

The WirelessTypes::DataCollectionMethod currently set on the Node.

Exceptions
getTimeBetweenBursts
TimeSpan getTimeBetweenBursts() const

Gets the amount of time between each burst currently set on the Node.  This is only used if the sampling mode is Synchronized Sampling Burst.

Returns

A TimeSpan representing 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.  If the Node is Sync Sampling and loses the beacon for a length of time greater than this value, then the node drops into a sleep mode. The Node will re-enter sync sampling within 2 minutes of the beacon reappearing.  Note: A value of 0 means the lost beacon timeout is disabled.  See Also: NodeFeatures::supportsLostBeaconTimeout

Returns

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 currently set on the Node.  See Also: NodeFeatures::channelGroups, NodeFeatures::supportsHardwareGain

Parameters
mask

The ChannelMask of the hardware gain to read.

Returns

The hardware gain currently set on the Node for the ChannelMask.

Exceptions
getHardwareOffset
uint16 getHardwareOffset(
const ChannelMask &mask
) const

Reads the hardware offset of the specified ChannelMask currently set on the Node.  See Also: NodeFeatures::channelGroups, NodeFeatures::supportsHardwareOffset

Parameters
mask

The ChannelMask of the hardware offset to read.

Returns

The hardware offset currently set on the Node for the ChannelMask.

Exceptions
getGaugeFactor
float getGaugeFactor(
const ChannelMask &mask
) const

Reads the gauge factor of the specified ChannelMask currently set on the Node.  See Also: NodeFeatures::channelGroups, NodeFeatures::supportsGaugeFactor

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.

Parameters
mask

The ChannelMask of the linear equation to read.

Returns

A LinearEquation object representing the linear equation that is applied to this ChannelMask.

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

Reads the unit of the specified ChannelMask currently set on the Node.  Note: This unit is just used for reference (such as when downloading logged data) and does not affect the actual data value.

Parameters
mask

The ChannelMask of the unit to read.

Returns

The WirelessTypes::CalCoef_Unit that is applied to this ChannelMask

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

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

Parameters
mask

The ChannelMask of the equation type to read.

Returns

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

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

Gets the filter settling time of the specified ChannelMask currently set on the Node.  See Also: NodeFeatures::channelGroups

Parameters
mask

The ChannelMask of the filter settling time to read.

Returns

The WirelessTypes::SettlingTime currently set on the Node for the ChannelMask.

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

Reads the WirelessTypes::ThermocoupleType of the specified ChannelMask currently set on the Node.  See Also: NodeFeatures::channelGroups

Parameters
mask

The ChannelMask of the thermocouple type to read.

Returns

The WirelessTypes::ThermocoupleType currently set on the Node for the <ChannelMask.

Exceptions
getFatigueOptions
FatigueOptions getFatigueOptions() const

Reads the FatigueOptions currently set on the Node.  See Also: NodeFeatures::supportsFatigueConfig

Returns

The FatigueOptions currently set on the Node.

Exceptions
getHistogramOptions
HistogramOptions getHistogramOptions() const

Reads the HistogramOptions currently set on the Node.  See Also: NodeFeatures::supportsHistogramConfig

Returns

The HistogramOptions currently set on the Node.

Exceptions
getActivitySense
ActivitySense getActivitySense() const

Reads the ActivitySense options currently set on the Node.  See Also: NodeFeatures::supportsActivitySense

Returns

The ActivitySense options currently set on the Node.

Exceptions