DatalogDownloader
DatalogDownloader

Used to download logged data from a WirelessNode.

Functions
DatalogDownloader
explicit DatalogDownloader(
const WirelessNode &node
)

Creates a DatalogDownloader object. Datalogging information will immediately be read from the Node.

Parameters
node

The WirelessNode to download the data from.

Exceptions
Constants
Datalogging Header Versions
HEADER_VERSION_1_0

Version 1.0

HEADER_VERSION_2_0

Version 2.0

HEADER_VERSION_2_1

Version 2.1

Variables
m_node
WirelessNode m_node

The WirelessNode to download the data from.

m_foundFirstTrigger
bool m_foundFirstTrigger

Whether or not the first trigger has been found.

m_outOfMemory
bool m_outOfMemory

Whether or not we requested data that is out of bounds of the memory.

m_currentByte
uint64 m_currentByte

The current byte position into the Node's memory.

m_sweepCount
uint64 m_sweepCount

The 0-based count indicating which sweep we are currently on in the data.

m_logPage
uint16 m_logPage

The last log page that contains datalogging data.

m_pageOffset
uint16 m_pageOffset

The byte offset into the last log page containing datalogging data.

m_nodeMemory
std::unique_ptr<NodeMemory> m_nodeMemory

The NodeMemory object to help with interacting with the Node's datalogging memory.

m_sessionInfo
DatalogSessionInfo m_sessionInfo

The <DatalogSessionInfo> containing information about the current trigger session data.

Functions
read_uint8
uint8 read_uint8(
uint64 &position
)

Reads a 1-byte unsigned integer from the Node's memory.

Parameters
position
uint64&

The 0-based position to read from. This value will be incremented by 1 if successful.

Returns

The 1-byte uint8 at the requested position in the Node's memory.

Exceptions
read_uint16
uint16 read_uint16(
uint64 &position
)

Reads a 2-byte unsigned integer from the Node's memory.

Parameters
position
uint64&

The 0-based position to read from. This value will be incremented by 2 if successful.

Returns

The uint16 at the requested position in the Node's memory.

Exceptions
read_uint32
uint32 read_uint32(
uint64 &position
)

Reads a 4-byte unsigned integer from the Node's memory.

Parameters
position
uint64&

The 0-based position to read from. This value will be incremented by 4 if successful.

Returns

The uint32 at the requested position in the Node's memory.

Exceptions
read_float
float read_float(
uint64 &position
)

Reads a 4-byte float from the Node's memory.

Parameters
position
uint64&

The 0-based position to read from.  This value will be incremented by 4 if successful.

Returns

The float at the requested position in the Node's memory.

Exceptions
read_string
std::string read_string(
uint64 &position,
uint64 length
)

Reads a string of the specified length from the Node's memory.

Parameters
position
uint64&

The 0-based position to start reading from. This value will be incremented by the length read if successful.

length
uint64

The size (number of characters) to read for.

Returns

The string at the requested position in the Node's memory, of the requested length.

Exceptions
isStartOfTrigger
bool isStartOfTrigger(
uint64 position
)

Checks whether the given position is a start of a new trigger session.

Parameters
position
uint64

The 0-based position to read from to check for a start of trigger.

Returns

true if a start of trigger was found, false otherwise.

Exceptions
parseTriggerHeader
void parseTriggerHeader()

Parses a trigger header from the current byte position. The current datalogging session info in this class is updated.

Exceptions
complete
bool complete()

Checks if all of the data has been downloaded (no more data available).

Returns

true if all the data has been downloaded, false if there is still more data to download.

getNextData
LoggedDataSweep getNextData()

Gets the next LoggedDataSweep that is logged to the Node.

Returns

A LoggedDataSweep containing the next data sweep that was logged to the Node.

Exceptions
startOfSession
bool startOfSession()

Gets whether a new datalogging session has been found (after calling getNextData).  This will be true for a single LoggedDataSweep, signifying that all of the DatalogDownloader's info has been updated with new information (sample rate, session index, etc.) about this sweep.

Returns

true if a new datalogging session has been found, false otherwise.

triggerType
WirelessTypes::TriggerType triggerType()

Gets the WirelessTypes::TriggerType of the current datalogging session.

Returns

The WirelessTypes::TriggerType of the current datalogging session.

totalSweeps
uint32 totalSweeps()

Gets the total number of sweeps that are in the current datalogging session.

Returns

The total number of sweeps that are in the current datalogging session.

sessionIndex
uint16 sessionIndex()

Gets the index of the current datalogging session.  This starts at 1 for the first session, and is incremented for each additional session.

Returns

The index of the current datalogging session.

sampleRate
const SampleRate& sampleRate()

Gets the SampleRate of the current datalogging session.

Returns

The SampleRate of the current datalogging session.

userString
const std::string& userString()

Gets the user entered string of the current datalogging session (if any).

Returns

The user entered string of the current datalogging session, or an empty string if none was provided.