SyncSamplingNetwork
SyncSamplingNetwork

Used to configure and start a Synchronized Sampling network of wireless nodes.

SyncSamplingNetwork
explicit SyncSamplingNetwork(
const BaseStation &networkBaseStation
)

Creates a SyncSamplingNetwork object used to configure and start a Synchronized Sampling network.

Parameters
networkBaseStation

The master BaseStation that will be the parent base station for this network, performing all the communication with the Nodes.

addNode
void addNode(
WirelessNode &node
)

Adds a WirelessNode to the Sync Sampling network. If the Node already exists in the network, it will not be added.  The Node's parent BaseStation should be the same as the network's master BaseStation.  The Node should have its sampling configuration set to a Synchronized Sampling mode prior to adding to be successfully added.

Parameters
node

The WirelessNode to add to the network.

Exceptions
addNode
void addNode(
WirelessNode &node,
const WirelessNodeConfig &pendingConfig
)

Adds a WirelessNode to the Sync Sampling network. If the Node already exists in the network, it will not be added.  The Node's parent BaseStation should be the same as the network's master BaseStation.  The Node should have its sampling configuration set to a Synchronized Sampling mode prior to adding to be successfully added.

Parameters
node

The WirelessNode to add to the network.

pendingConfig

A pending WirelessNodeConfig to set for the node. This will be used in all network calculations.

Exceptions
removeNode
void removeNode(
NodeAddress nodeAddress
)

Removes a WirelessNode from the Sync Sampling network, if it exists in the network.

Parameters
nodeAddress

The node address of the WirelessNode to be removed.

Exceptions
percentBandwidth
float percentBandwidth() const

Gets the total percent bandwidth for the Sync Sampling Network.  This includes nodes that could not find TDMA slots, but does not include nodes who failed to communicate (status of <status_PoorCommunication>).

Returns

The percent of bandwidth for the entire Sync Sampling Network.

ok
bool ok() const

Gets whether the Sync Sampling Network is OK (true), or has problems such as exceeding bandwidth (false).

Returns

true if the network is OK (all nodes fit in the network, no communication issues, etc.), false if the network has a problem.

refresh
void refresh()

Refreshes the Sync Sampling Network.  This function must be called when any WirelessNode has changed its configuration after being added to the network!

Exceptions
lossless
bool lossless() const

Gets whether the lossless option is enabled or not for the entire network (default of enabled).  The lossless feature enables buffering and retransmissions in order to provide 100% packet success rate under most operating conditions.  This does, however, have a possible increase in latency, especially in poor RF environments.

Returns

true if the lossless option is enabled, false if it is disabled.

lossless
void lossless(
bool enable
)

Enables or Disables the lossless option for the entire network. If changed, refresh will be called.  The lossless feature enables buffering and retransmissions in order to provide 100% packet success rate under most operating conditions.  This can, however, cause a possible increase in latency, especially in poor RF environments.

Parameters
enable
bool

Whether the lossless option should be enabled (true) or disabled (false).

Exceptions
highCapacity
bool highCapacity() const

Gets whether the high capacity option is enabled or not for the entire network (default of false).  The high capacity feature reduces transmit rates in order to optimize bandwidth and power savings among nodes with slower sample rates.  This can, however, increase the transmit interval from 1 second to (1 to 16) seconds.

Returns

true if the high capacity option is enabled, false if it is disabled.

highCapacity
void highCapacity(
bool enable
)

Enables or Disables the high capacity option for the entire network. If changed, refresh will be called.  The high capacity feature reduces transmit rates in order to optimize bandwidth and power savings among nodes with slower sample rates.  This can, however, increase the transmit interval from 1 second to (1 to 16) seconds.

Parameters
enable
bool

Whether the high capacity option should be enabled (true) or disabled (false).

Exceptions
applyConfiguration
void applyConfiguration()

Applies the Sync Sampling network settings to all of the nodes in the network.  This action is required before starting a Sync Sampling network. The network status must be OK before this can be called.  Calling this function repeatedly will only affect the node's that haven't had their configuration applied successfully. This can be useful if some nodes successfully apply, while others fail to communicate.  Note: This will clear any "pending" configurations that any nodes have in the network.  You must manually apply those configuration templates to the nodes if you want them to actually be applied to the devices.

Exceptions
startSampling
void startSampling()

Starts the network sampling by sending the start command to each node, and then starting the beacon on the master basestation with the current system time.  applyConfiguration must be called before this function is called.  Calling this function repeatedly will only start the node's that haven't been started already. This can be useful if some nodes successfully start, while others fail to communicate. The beacon will not be started until all nodes have started.

Exceptions
startSampling
void startSampling(
Timestamp startTime
)

Starts the network sampling by sending the start command to each node, and then starting the beacon on the master basestation with the given TimestampapplyConfiguration must be called before this function is called.  Calling this function repeatedly will only start the node's that haven't been started already. This can be useful if some nodes successfully start, while others fail to communicate. The beacon will not be started until all nodes have started.

Parameters
startTime

The Timestamp to enable the beacon with, which ultimately determines the times for the nodes in the network.

Exceptions
startSampling_noBeacon
void startSampling_noBeacon()

Sends the start command to each node in the network. The beacon is not started. Note: The nodes will not actually start sampling until they hear a beacon.  applyConfiguration must be called before this function is called.  Calling this function repeatedly will only start the node's that haven't been started already. This can be useful if some nodes successfully start, while others fail to communicate.

Exceptions
getNodeNetworkInfo
SyncNetworkInfo& getNodeNetworkInfo(
uint16 nodeAddress
)

Gets the SyncNetworkInfo object containing network information on the specified WirelessNode within the Sync Sampling network.

Parameters
nodeAddress
uint16

The node address of the WirelessNode to find the network info of. This node must already be in the network.

Returns

A constant reference to the SyncNetworkInfo containing the networking information for the specified node in the network.

Exceptions
setPendingConfig
void setPendingConfig(
uint16 nodeAddress,
const WirelessNodeConfig &config
)

Sets a pending configuration for a specific WirelessNode in the network.  This is a configuration that is not actually applied to the Node, but used in all network calculations. In this way, you may see how some configuration changes affect the network bandwidth before applying the configuration.  This function automatically calls refresh on the network.

Parameters
nodeAddress
uint16

The node address of the WirelessNode to set the pending config for.

config

The WirelessNodeConfig to set for the Node.

Exceptions
clearPendingConfig
void clearPendingConfig(
uint16 nodeAddress
)

Clears a pending config that is currently set for a specific WirelessNode in the network.  By clearing the pending config, the network will recalculate using the configuration that is currently set on the Wireless Node.  This function automatically calls refresh on the network.

Parameters
nodeAddress
uint16

The node address of the WirelessNode to set the pending config for.

Exceptions
clearAllPendingConfigs
void clearAllPendingConfigs()

Clears all pending configurations that are currently set in the network.  By clearing the pending configs, the network will recalculate using the configurations currently set on the Wireless Nodes.  This function automatically calls refresh on the network if any pending configurations were cleared.

Exceptions
addNodeToNetwork
void addNodeToNetwork(
WirelessNode &node,
const WirelessNodeConfig *pendingConfig nullptr
)

Adds a WirelessNode to the Sync Sampling network, with or without a given pending WirelessNodeConfig.  If the Node already exists in the network, it will not be added.  The Node's parent BaseStation should be the same as the network's master BaseStation.  The Node should have its sampling configuration, or the provided pending configuration, set to a Synchronized Sampling mode prior to adding to be successfully added.

Parameters
node

The WirelessNode to add to the network.

pendingConfig

The WirelessNodeConfig to add to the network (default of null).

Exceptions