44 constellation->inView = system.
inView;
47 constellation->inUse = *system.
inUse;
55 : _navigation(navigation)
61 _satelliteAssembler.
clear();
62 _pendingSatellites.clear();
63 _navigationAssembler.
reset();
75GPSReceiveUpdates GPSNMEAStream::_decodeStandard(std::string_view line,
GPSDecodeContext& context)
81 const uint64_t now = context.
nowUs();
83 auto satelliteUpdate = _satelliteAssembler.
ingest(*sentence, now);
84 _queueSatellites(satelliteUpdate.completed);
89 const auto update =
sentence->type() ==
"GSA" && navigation && navigation->valid && !satelliteUpdate.accepted
90 ? std::optional<NMEA::NavigationUpdate>()
91 : _navigationAssembler.ingest(*
sentence, now);
103 applyNavigationEpoch(_position, update->epoch);
108 applyNavigationEpoch(_position, update->epoch);
114GPSReceiveUpdates GPSNMEAStream::_finishLine(GPSReceiveUpdates updates,
GPSDecodeContext& context)
116 _publishSatellites(context);
125 const uint64_t now = context.
nowUs();
127 applyNavigationEpoch(_position, *expired);
129 _queueSatellites(_satelliteAssembler.
flushDue(now));
130 _publishSatellites(context);
135 if (
const auto deadline = _satelliteAssembler.
deadlineUs()) {
150 for (
const auto& system : epoch) {
152 _pendingSatellites.push_back(system);
159 for (
const auto& system : _pendingSatellites) {
162 _pendingSatellites.clear();
std::optional< uint8_t > gpsSatellitesUsed(std::optional< unsigned > count)
A reported used-satellite count; receivers report UINT8_MAX and above when the count is unknown.
void serviceControls()
Runs the family's streaming services once under SERVICE_TIMEOUT, then flushes. Nested calls do nothin...
GPSReceiveUpdates receiveCycle(std::chrono::milliseconds timeout)
void publishSatelliteUsage(std::optional< int > count)
void publishPosition(const GPSDecodedPosition &report)
void publishRTCM(std::span< const uint8_t > frame)
void publishSatellites(const GPSDecodedSatellites &report)
GPSReceiveUpdates receive(GPSCommandChannel &channel, std::chrono::milliseconds timeout) const
GPSNMEAStream(Navigation navigation=Navigation::StandardNMEA)
void flush(GPSDecodeContext &context)
Expires untimed metadata and publishes satellite epochs that became due.
void reset(GPSStreamDemux &stream)
Starts a new receiver session: clears every framer of stream, the epochs and the working reports.
Navigation
Who turns sentences into positions: this stream from standard NMEA, or the family's own sentences.
std::chrono::milliseconds limitReceiveTimeout(std::chrono::milliseconds timeout, uint64_t nowUs) const
Shortens a receive timeout so a pending satellite epoch is published when it becomes due.
std::optional< NavigationEpoch > expireUntimedMetadata(uint64_t nowUs)
std::optional< uint64_t > deadlineUs() const
Update ingest(const Sentence &input, uint64_t receivedAtUs)
SatelliteEpoch flushDue(uint64_t nowUs)
constexpr double DEG_TO_RAD
std::optional< Sentence > sentence(std::string_view text)
std::vector< SatelliteSystem > SatelliteEpoch
std::optional< NavigationStatus > navigationStatus(const Sentence &input)
std::chrono::milliseconds remaining(uint64_t nowUs) const
Rounded up to whole milliseconds and capped at INT32_MAX milliseconds.
Decoded navigation plus whether the producer accepted its velocity solution.
GPSNavigationValues navigation
Constellation * ensureConstellation(GPSConstellation constellation)
std::optional< uint8_t > satellitesUsed
float verticalAccuracyMeters
float speedMetersPerSecond
float horizontalAccuracyMeters
double altitudeEllipsoidMeters
std::optional< double > horizontalDop
std::optional< double > horizontalAccuracyMeters
std::optional< double > verticalDop
std::optional< double > altitudeEllipsoidMeters() const
std::optional< double > altitudeMslMeters
std::optional< double > courseDegrees
std::optional< double > verticalAccuracyMeters
std::optional< unsigned > satellitesUsed
std::optional< double > speedMetersPerSecond
uint64_t positionReceivedAtUs
uint64_t inViewTimestampUs
uint64_t inUseTimestampUs
std::optional< int > inUse
GPSConstellation constellation