QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
GPSDecodedData::SatelliteCounts Class Reference

#include <GPSDecodedData.h>

Public Member Functions

GPSSatelliteReport update (const GPSDecodedSatellites &source, uint64_t nowUs)
GPSSatelliteReport update (const GPSDecodedSatelliteUsage &source, uint64_t nowUs)
 Records a count-only used count.
std::optional< GPSSatelliteReport > expire (uint64_t nowUs)

Static Public Attributes

static constexpr std::chrono::milliseconds FRESHNESS_TIMEOUT {5000}

Detailed Description

The satellite counts GPSDriver reports. Each constellation keeps its latest in-view and used counts, each with its own receipt, until FRESHNESS_TIMEOUT has passed. A full snapshot replaces every constellation; a delta replaces only the counts it carries, and never with an older receipt. The used count sums the constellations in view, and is zero when none has satellites in view; while one with satellites in view lacks a used count, the latest count-only report stands in.

Definition at line 20 of file GPSDecodedData.h.

Member Function Documentation

◆ expire()

std::optional< GPSSatelliteReport > GPSDecodedData::SatelliteCounts::expire ( uint64_t nowUs)

Drops the counts that expired by nowUs. Poll on every receive, including those without satellite reports.

Returns
the report when a count expired.

Definition at line 55 of file GPSDecodedData.cc.

◆ update() [1/2]

◆ update() [2/2]

GPSSatelliteReport GPSDecodedData::SatelliteCounts::update ( const GPSDecodedSatelliteUsage & source,
uint64_t nowUs )

Records a count-only used count.

Returns
a report whose used count is this one.

Definition at line 48 of file GPSDecodedData.cc.

References GPSDecodedSatelliteUsage::usedCount.

Member Data Documentation

◆ FRESHNESS_TIMEOUT

std::chrono::milliseconds GPSDecodedData::SatelliteCounts::FRESHNESS_TIMEOUT {5000}
staticconstexpr

Definition at line 23 of file GPSDecodedData.h.


The documentation for this class was generated from the following files: