QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
GPSCommand.h File Reference
#include <algorithm>
#include <array>
#include <chrono>
#include <cstddef>
#include <cstdint>
#include <functional>
#include <optional>
#include <span>
#include <string_view>
#include <utility>
#include <variant>
#include <vector>
#include <QtCore/QByteArray>
#include <QtCore/QByteArrayView>
#include "GPSStreamDemux.h"
+ Include dependency graph for GPSCommand.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  GPSConfigurationEvidence
 Evidence from one configuration command, not a claim of physical receiver operation. More...
 
struct  GPSConfigurationStep
 
class  GPSRawAckMatcher
 Bounded raw-byte matching for receivers whose replies need not be complete ASCII lines. More...
 
struct  GPSCommandSequence
 
struct  GPSCommandSequence::RawReply
 Matched in the raw received bytes, for replies that need not be complete frames (see GPSRawAckMatcher). More...
 
struct  GPSCommandSequence::Command
 
struct  GPSCommandSequence::Result
 
struct  GPSCommandOptions
 

Typedefs

using GPSTextMatcher = std::function< GPSCommandOutcome(std::string_view reply)>
 Resolves the outstanding command from one text reply a decoder offers; Pending keeps waiting.
 
using GPSFrameMatcher = std::function< GPSCommandOutcome(const GPSFrame &frame)>
 Resolves the outstanding command from each dispatched frame, after the family decoded it; Pending keeps waiting.
 
using GPSReplyPoll = std::function< GPSCommandOutcome()>
 Polled after each decoded chunk, for replies a family tracks in its own decoder state; Pending keeps waiting.
 

Enumerations

enum class  GPSProtocolError : uint8_t {
  None , Cancelled , Transport , Protocol ,
  InvalidArgument , ConsentRequired
}
 Sticky failure of the current receiver session; I/O and control stop until the next configure(). More...
 
enum class  GPSCommandOutcome {
  Pending , Written , Acknowledged , ReadbackVerified ,
  Rejected , TimedOut , Cancelled , TransportError
}
 

Functions

GPSCommandSequence::Command gpsCommand (QByteArray wire, std::chrono::milliseconds timeout, std::variant< GPSTextMatcher, GPSCommandSequence::RawReply > reply, GPSCommandOptions options={})
 

Typedef Documentation

◆ GPSFrameMatcher

using GPSFrameMatcher = std::function<GPSCommandOutcome(const GPSFrame& frame)>

Resolves the outstanding command from each dispatched frame, after the family decoded it; Pending keeps waiting.

Definition at line 71 of file GPSCommand.h.

◆ GPSReplyPoll

using GPSReplyPoll = std::function<GPSCommandOutcome()>

Polled after each decoded chunk, for replies a family tracks in its own decoder state; Pending keeps waiting.

Definition at line 73 of file GPSCommand.h.

◆ GPSTextMatcher

using GPSTextMatcher = std::function<GPSCommandOutcome(std::string_view reply)>

Resolves the outstanding command from one text reply a decoder offers; Pending keeps waiting.

Definition at line 69 of file GPSCommand.h.

Enumeration Type Documentation

◆ GPSCommandOutcome

enum class GPSCommandOutcome
strong
Enumerator
Pending 
Written 
Acknowledged 
ReadbackVerified 
Rejected 
TimedOut 
Cancelled 
TransportError 

Definition at line 32 of file GPSCommand.h.

◆ GPSProtocolError

enum class GPSProtocolError : uint8_t
strong

Sticky failure of the current receiver session; I/O and control stop until the next configure().

Enumerator
None 
Cancelled 

A stop was requested; not a receiver or link fault.

Transport 

The link could not read, write, or change its baud rate.

Protocol 

The receiver violated or rejected the control protocol.

InvalidArgument 

The driver requested an invalid write, or received before configuring.

ConsentRequired 

Configuration needs a persistent receiver change the caller did not allow.

Definition at line 22 of file GPSCommand.h.

Function Documentation

◆ gpsCommand()

GPSCommandSequence::Command gpsCommand ( QByteArray  wire,
std::chrono::milliseconds  timeout,
std::variant< GPSTextMatcher, GPSCommandSequence::RawReply >  reply,
GPSCommandOptions  options = {} 
)
inline

One sequence command that writes wire and waits up to timeout for reply. Evidence names it by its label, or by wire without its line ending.

Definition at line 162 of file GPSCommand.h.

Referenced by Quectel::Plan::command(), Femto::Plan::fixedBase(), Ashtech::Plan::fixedPositionCommand(), and Ashtech::Plan::sequence().