8#include <QtCore/QByteArray>
9#include <QtCore/QDeadlineTimer>
10#include <QtCore/QObject>
11#include <QtCore/QString>
12#include <QtCore/QThread>
38 QObject* parent =
nullptr,
GPSClock clock = {});
50 bool wait(QDeadlineTimer deadline = QDeadlineTimer(QDeadlineTimer::Forever));
84 std::unique_ptr<QThread> _thread;
88 bool _endsWhenIdle =
true;
Issues tokens and cancels them all at once. Copies share the cancellation.
static constexpr std::chrono::milliseconds RECEIVE_TIMEOUT
Longest wait for one read before the session re-checks cancellation.
void inputProblem(GPSInputProblem problem)
virtual void start()
Starts the session once; later calls are ignored.
void connectionError(GPSConnectionError error, const QString &detail={})
detail is the transport's or the protocol's diagnostic, or empty when it gave none.
bool wait(QDeadlineTimer deadline=QDeadlineTimer(QDeadlineTimer::Forever))
Waits for the worker to exit; returns true at once when the session never started.
void finished()
Delivered on this object's thread once the session thread has finished.
friend class GPSReceiverTest
void receiverReady(const QString &identity={})
identity is the receiver model and firmware, or empty when the family does not report them.
void satelliteInfoUpdated(const GPSSatelliteReport &message)
void surveyInStatusUpdated(const GPSSurveyReport &report)
~GPSReceiverWorker() override
void receiverDetected(GPSType type)
void setEndsWhenIdle(bool endsWhenIdle)
std::function< std::unique_ptr< GPSTransport >(GPSCancelToken)> TransportFactory
Consumed on the worker thread, so transport construction, I/O and destruction share that thread.
static constexpr std::chrono::milliseconds USEFUL_DATA_TIMEOUT
friend class GPSReceiverWorkerTest
void rtcmDataReceived(const QByteArray &message, qint64 receivedAtMs)
RTCM output the receiver sent, stamped with the steady clock when it was read.
void positionUpdated(const GPSPositionReport &report)
GPSInputProblem
Why a receiver that stays connected while silent reports no position.
The monotonic clock receiver sessions run on: the steady clock unless tests inject a virtual one.