7#include <QtCore/QString>
45 bool _rtcmOutputActive =
false;
47 bool _rtcmActivationPending =
false;
54 _rtcmOutputActive =
false;
55 _rtcmActivationPending =
false;
60 _nmea.setRTCMEnabled(
false);
70 if (!identity.succeeded()) {
81 _nmea.setRTCMEnabled(
true);
83 _ready = !channel.
failed();
89 if (_rtcmActivationPending) {
90 _rtcmActivationPending =
false;
91 _activateRTCMOutput(channel);
98 const auto* fixed = std::get_if<GPSBaseStationConfig::Fixed>(&_base.mode);
103 _surveyClock.start(context);
109 _activateRTCMOutput(channel);
110 if (_rtcmOutputActive) {
118 _rtcmOutputActive =
true;
122GPSReceiveUpdates Protocol::_decodeLine(std::string_view line,
GPSDecodeContext& context)
124 if (
line.size() >= 6 &&
line.substr(3, 3) ==
"GGA") {
132 _surveyClock.finish(context,
true,
133 {.latitudeDegrees = fix->latitude,
134 .longitudeDegrees = fix->longitude,
135 .altitudeMeters = fix->altitude + fix->geoidSeparation});
136 _rtcmActivationPending =
true;
139 _surveyClock.publishProgress(context);
143bool portName(std::string_view field)
145 const size_t digits = field.find_first_of(
"0123456789");
146 if (digits == 0 || digits == std::string_view::npos) {
155QLatin1StringView signature(
const GPSFrame& frame)
157 const std::string_view text =
frame.text();
162 return QLatin1StringView(
"abbreviated ASCII replies");
165 return log && portName(log->source) ? QLatin1StringView(
"NovAtel-format ASCII logs") : QLatin1StringView();
171 bool identified =
false;
183 .
type = GPSType::femto,
184 .logCategory = &FemtoProtocolLog,
188 .create = &gpsCreateProtocol<Protocol>,
189 .signature = &signature,
std::optional< GPSASCIILog > gpsASCIILog(std::string_view line)
@ Protocol
The receiver violated or rejected the control protocol.
@ ASCIILine
Printable lines up to CR/LF, without the terminator; the decoder checks checksums.
@ RTCM3
0xD3 frames with a valid CRC-24Q.
@ NMEASentence
'$' to a valid "*hh" checksum, without a line ending.
#define QGC_LOGGING_CATEGORY(name, categoryStr)
GPSDecodeContext & context()
bool setBaudrate(unsigned baudrate)
void failSequence(const GPSCommandSequence::Result &result)
GPSStreamDemux & stream()
bool runRequired(const GPSCommandSequence &sequence)
Runs sequence and fails control over a failed step as failSequence() does.
GPSCommandSequence::Result runSequence(const GPSCommandSequence &sequence)
Runs sequence in order until a required step fails or I/O fails; failed attempts retry up to their co...
void failNoAnswer(std::span< const unsigned > rates)
void publishSurvey(GPSSurveyReport &status)
Stamps status with the receipt time and publishes a copy. Survey progress is not an update flag.
virtual void serviceStreaming(GPSCommandChannel &channel)
virtual bool probe(GPSCommandChannel &channel)
virtual bool configure(GPSCommandChannel &channel, GPSConfig config, unsigned &baud)=0
virtual GPSReceiveUpdates _decodeLine(std::string_view line, GPSDecodeContext &context)=0
Decodes one line after standard NMEA did.
void setEnabled(GPSFrameKind kind, bool enabled)
Enables or disables an available framer; either way it restarts from an empty state.
Host-timed survey-in duration for receivers that report completion but not elapsed time.
constexpr std::array BAUD_RATES
Rates the port query probes, in order. Trimble receivers default to 115200.
QByteArray line(std::string_view command)
command as one CR/LF-terminated line.
const GPSReceiverFamily FAMILY
constexpr std::string_view REJECTED
constexpr unsigned AVERAGED_POSITION_QUALITY
GGA fix quality of a position the receiver holds fixed: position averaging finished.
GPSCommandSequence sequence(std::span< const Command > commands)
constexpr std::array IDENTIFY
Stops every log on this port and identifies the receiver, in up to IDENTIFY_ROUNDS rounds.
GPSCommandSequence fixedBase(const GPSEllipsoidPosition &position)
ELLIPSOID_HEIGHTS, FIX_POSITION for position, then GGA_OUTPUT.
constexpr std::array RTCM_OUTPUT
RTCM3 output once the base position is known.
constexpr std::array SURVEY_IN
Survey-in base: receiver position averaging. A GGA fix of quality 7 completes it, and RTCM_OUTPUT fol...
constexpr unsigned IDENTIFY_ROUNDS
constexpr Command VERSION
Identifies the receiver without changing it, so receiver detection probes with it alone.
constexpr unsigned BAUD
The link rate unless one is selected or detected, and the only rate receiver detection probes.
Femtomes receivers: ASCII commands, with GGA sentences and RTCM3 output, set up as RTK base stations.
std::optional< Sentence > sentence(std::string_view text)
constexpr bool isAsciiUpper(char ch)
std::optional< GGA > gga(const Sentence &input)
Quality zero is a valid fix-loss observation with empty coordinates and optional hemisphere fields.
constexpr bool isAsciiDigit(char ch)
Locale-independent ASCII character classes for receiver text.
std::optional< Frame > frame(std::string_view text)
Configuration used only by the RTK base-station role.
The receiver configuration requested for one configure() attempt.