Class LocationDataHandler

Class Documentation

class LocationDataHandler

Location data handler to assemble split Location packet stream into full measurement.

It will store each packet in binary form till all packets were received. Assemble will convert all stored PDUs to a list of locations.

Public Types

using LocationDataPduRaw = std::array<uint8_t, LocationDataPdu::kPduSize>

Public Functions

LocationDataHandler()

Construct a new LocationDataHandler object.

void handle_pdu(const LocationDataPduRaw &buffer)

Handle PDU.

If the PDU is a new measurement (based on different block counter), reset internal buffer and set expected number of locations and PDUs.

Either way append the PDU to the internal storage.

Parameters:

buffer – Location PDU as byte buffer

bool finished()

True if all location data packets from one measurement received, false otherwise.

LocationData assemble()

Process and assemble received raw PDUs to location data.

Returns:

Assembled location data containing header and all received locations

Public Static Attributes

static constexpr uint8_t kMaxNumPdu = {64U}
static constexpr uint8_t kBlockCounterOffset = {24U}
static constexpr uint8_t kBlockNumberLocsOffset = {35U}