11#include <QtCore/QLatin1StringView>
12#include <QtCore/QString>
32 void push(std::span<const uint8_t> bytes);
38 [[nodiscard]]
const std::optional<Match>&
match()
const {
return _match; }
44 void frame(
const GPSFrame& frame)
override;
46 std::span<const GPSReceiverFamily* const> _families;
48 std::optional<Match> _match;
49 bool _framedTraffic =
false;
65 [[nodiscard]]
bool found()
const {
return family !=
nullptr; }
84 static constexpr std::chrono::milliseconds
TIMEOUT{45000};
85 static constexpr std::array<unsigned, 8>
BAUD_PRIORITY{115200, 38400, 460800, 9600, 230400, 921600, 57600, 19200};
95 [[nodiscard]]
static std::vector<unsigned>
baudCandidates(std::span<const GPSReceiverFamily* const> families);
101 enum class Listen : uint8_t
112 std::span<const GPSReceiverFamily* const> _families;
GPSProtocolError
Sticky failure of the current receiver session; I/O and control stop until the next configure().
static constexpr std::chrono::milliseconds TIMEOUT
static constexpr std::chrono::milliseconds LISTEN_WINDOW
GPSReceiverDetection detect(unsigned baud=0)
Identifies the receiver at baud, which then every family is probed at, or else at each baudCandidates...
static std::vector< unsigned > baudCandidates(std::span< const GPSReceiverFamily *const > families)
The rates detection tries without a fixed rate: every candidate rate of families, in likelihood order...
static constexpr std::array< unsigned, 8 > BAUD_PRIORITY
void push(std::span< const uint8_t > bytes)
const std::optional< Match > & match() const
The first family signature since the last reset.
void reset()
Forgets partial frames and findings, as after a rate change.
bool framedTraffic() const
Standard NMEA sentences or RTCM3 frames arrived, so the link runs at the receiver's rate.
Evidence from one configuration command, not a claim of physical receiver operation.
The receiver detection found, or why it found none.
const GPSReceiverFamily * family
Null when no family was identified.
GPSProtocolError error
Protocol when nothing was identified; Cancelled or Transport when the link ended detection.
unsigned baud
The rate the receiver answered at.
QString evidence
What identified it: a signature such as "UBX frames", or "identity query".
const GPSReceiverFamily * family
QLatin1StringView evidence
What identified the family, such as "UBX frames".