WirelessDataPacket
public
WirelessPacket
WirelessDataPacket
AsyncDigitalAnalogPacket
AsyncDigitalPacket
BeaconEchoPacket
BufferedLdcPacket
and 9 other children

A class representing a Wireless Data Packet.

Functions
WirelessDataPacket
WirelessDataPacket()

The default constructor for a Wireless Data Packet

Variables
m_dataSweeps
std::vector<DataSweep> m_dataSweeps

Contains one or more data sweeps

m_sweepPos
uint32 m_sweepPos

The current position into m_dataSweeps to get the next sweep at

m_dataType
WirelessTypes::DataType m_dataType

The type of data that is present in the packet

m_sweepSize
uint32 m_sweepSize

The size of a single sweep within this packet

m_numSweeps
std::size_t m_numSweeps

The number of sweeps within this packet

m_payloadOffsetChannelData
uint16 m_payloadOffsetChannelData

The offset into the payload of the data packet where channel data starts.

Functions
addSweep
void addSweep(
const DataSweep &sweep
)

Adds a single DataSweep to the data packet

Parameters
sweep
const DataSweep&

The DataSweep to add to the data packet

addDataPoint
void addDataPoint(
ChannelData &container,
uint8 channelNumber,
int channelDataIndex,
int sweepIndex,
WirelessChannel::ChannelId channelName
) const

Adds a WirelessDataPoint from a payload to the given <ChannelData> container.

Parameters
container
ChannelData&

The <ChannelData> container to add the data point to.

channelNumber
uint8

The channel number to set (ch1 = 1, ch8 = 8).

channelDataIndex
int

The index into the channel data (not the actual channel index). ex. if channel 1 and 3 are active, channel 1 = index 0 and channel 3 = index 1.

sweepIndex
int

The index of the sweep into the packet starting at index 0.

channelName

The WirelessChannel::ChannelId to give to the WirelessDataPoint.

wirelessChannelFromChNum
virtual WirelessChannel::ChannelId wirelessChannelFromChNum(
int channelNum
)

Converts a channel number to a WirelessChannel

Parameters
channelNum
int

The channel number to convert (starting at index 1, so channel 1 = 1, channel 8 = 8)

Returns

The WirelessChannel representing the passed in channel number

getPayloadData
void getPayloadData(
size_t payloadPosition,
anyType &result
) const

Reads a value out of the packet's payload based on the given position and the data's DataType.

Parameters
payloadPosition
size_t

The position into the payload to read from.

result

The anyType to hold the resulting payload data.

getNextSweep
void getNextSweep(
DataSweep &sweepResult
)

Gets the next DataSweep in the packet

Parameters
sweepResult

The DataSweep to hold the result.

numSweeps
std::size_t numSweeps() const

Gets the total number of DataSweeps that are in this data packet

Returns

The total number of DataSweeps that are in this data packet

numSweepsRemaining
std::size_t numSweepsRemaining() const

Gets the number of remaining DataSweeps that have not been obtained by the user

Returns

The number of remaining DataSweeps that have not been obtained by the user

moreSweeps
bool moreSweeps() const

Whether or not there are more DataSweeps in the data packet

Returns

true if there are more DataSweeps available, false otherwise