QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
Quectel::Plan Namespace Reference

Classes

struct  MessageRate
 

Functions

QByteArray writeBase (const GPSBaseStationConfig::Mode &mode, const GPSProtocolMath::Ecef &position, bool distanceField)
 
GPSCommandSequence::Command command (QByteArrayView body, GPSTextMatcher reply, std::chrono::milliseconds timeout=COMMAND_TIMEOUT)
 body labelled by its text, framed as a sentence, and completed by reply within timeout.
 
GPSTextMatcher acknowledgement (QByteArrayView body)
 Completes the setting body with its "<name>,OK" acknowledgement.
 
GPSCommandSequence messageRates (std::span< const MessageRate > rates)
 PQTMCFGMSGRATE,W for each of rates, each followed by its PQTMCFGMSGRATE,R readback.
 

Variables

constexpr std::chrono::milliseconds COMMAND_TIMEOUT {1000}
 Per attempt, unless a command gives its own.
 
constexpr std::chrono::milliseconds CONFIGURATION_TIMEOUT {45000}
 For the whole configuration after validation.
 
constexpr std::array BAUD_RATES {460800u, 115200u, 230400u, 921600u, 57600u, 9600u}
 Rates the identity query probes, in order.
 
constexpr std::string_view IDENTIFY = "PQTMVERNO"
 
constexpr std::string_view QUALIFIED_FIRMWARE = "LG290P03"
 
constexpr std::string_view READ_ROLE = "PQTMCFGRCVRMODE,R"
 Receiver role: "PQTMCFGRCVRMODE,OK,<role>", where 2 is the base station.
 
constexpr unsigned BASE_ROLE = 2
 
constexpr std::string_view WRITE_BASE_ROLE = "PQTMCFGRCVRMODE,W,2"
 
constexpr std::string_view READ_FIX_RATE = "PQTMCFGFIXRATE,R"
 Base positioning runs at 1 Hz: "PQTMCFGFIXRATE,OK,1000".
 
constexpr unsigned FIX_INTERVAL_MS = 1000
 
constexpr std::string_view READ_BASE = "PQTMCFGSVIN,R"
 
constexpr std::chrono::hours MAXIMUM_SURVEY_DURATION {24}
 
constexpr double MAXIMUM_SURVEY_ACCURACY_METERS = 1000
 
constexpr std::string_view RESTART_SURVEY = "PQTMCFGSVIN,W"
 Re-runs a survey with exactly the fields READ_BASE reported.
 
constexpr std::string_view FIXED_BASE_LABEL = "PQTMCFGSVIN,W (fixed position)"
 Labels for the base writes whose bodies carry ECEF coordinates.
 
constexpr std::string_view RESTART_SURVEY_LABEL = "PQTMCFGSVIN,W (survey restart)"
 
constexpr std::string_view SAVE = "PQTMSAVEPAR"
 Saves the current settings to flash.
 
constexpr std::chrono::milliseconds SAVE_TIMEOUT {5000}
 
constexpr std::string_view RESTART = "PQTMSRR"
 
constexpr std::chrono::milliseconds RESTART_TIMEOUT {8000}
 
constexpr std::chrono::milliseconds RESTART_POLL {200}
 
constexpr std::chrono::milliseconds RESTART_IDENTIFY_TIMEOUT {700}
 
constexpr std::array BASE_OUTPUT
 Base output: survey-in status, RTCM3 station coordinates and MSM observations.
 
constexpr std::array NMEA_OUTPUT
 NMEA output: position, position accuracy, satellites used and satellites in view, every second.
 

Detailed Description

LG290P(03) base-station configuration, from Quectel's LG290P(03)&LGx80P(03) GNSS Protocol Specification V1.1 (§§2.3.9, 2.3.15, 2.3.22–25, 2.3.28) and Base Station Mode Application Note V1.1 §3.2. Commands are PQTM sentence bodies, sent as "$<body>*hh\r\n"; the receiver answers "<name>,OK[,<values>]" or "<name>,ERROR,<code>".

Role and base settings take effect only once saved with SAVE and restarted with RESTART, so configuration reads them back after a restart before trusting them. It changes and saves them only with consent to persistent changes; with consent it first restarts, so it works from the saved settings rather than another client's unsaved ones. The note permits re-running an unchanged survey (RESTART_SURVEY) and restarting without saving.

Function Documentation

◆ acknowledgement()

GPSTextMatcher Quectel::Plan::acknowledgement ( QByteArrayView  body)

Completes the setting body with its "<name>,OK" acknowledgement.

Definition at line 55 of file QuectelPlan.cc.

References QuectelCodec::acknowledgement().

Referenced by messageRates().

◆ command()

GPSCommandSequence::Command Quectel::Plan::command ( QByteArrayView  body,
GPSTextMatcher  reply,
std::chrono::milliseconds  timeout 
)

body labelled by its text, framed as a sentence, and completed by reply within timeout.

Definition at line 50 of file QuectelPlan.cc.

References NMEAUtils::frame(), and gpsCommand().

Referenced by messageRates().

◆ messageRates()

GPSCommandSequence Quectel::Plan::messageRates ( std::span< const MessageRate >  rates)

PQTMCFGMSGRATE,W for each of rates, each followed by its PQTMCFGMSGRATE,R readback.

Definition at line 63 of file QuectelPlan.cc.

References acknowledgement(), command(), and GPSCommandSequence::steps.

◆ writeBase()

QByteArray Quectel::Plan::writeBase ( const GPSBaseStationConfig::Mode &  mode,
const GPSProtocolMath::Ecef &  position,
bool  distanceField 
)

The PQTMCFGSVIN,W body for mode: fixed position ECEF coordinates, or a survey-in by observation count and accuracy. distanceField adds a zero distance field, for firmware whose READ_BASE reply has one.

Definition at line 33 of file QuectelPlan.cc.

References gpsFixedDecimal().

Variable Documentation

◆ BASE_OUTPUT

constexpr std::array Quectel::Plan::BASE_OUTPUT
inlineconstexpr
Initial value:
{
MessageRate{.message = "PQTMSVINSTATUS", .version = "1"},
MessageRate{.message = "RTCM3-1005"},
MessageRate{.message = "RTCM3-107X", .version = "0"},
}
std::string_view message
Definition QuectelPlan.h:71

Base output: survey-in status, RTCM3 station coordinates and MSM observations.

Definition at line 78 of file QuectelPlan.h.

◆ BASE_ROLE

constexpr unsigned Quectel::Plan::BASE_ROLE = 2
inlineconstexpr

Definition at line 39 of file QuectelPlan.h.

◆ BAUD_RATES

constexpr std::array Quectel::Plan::BAUD_RATES {460800u, 115200u, 230400u, 921600u, 57600u, 9600u}
inlineconstexpr

Rates the identity query probes, in order.

Definition at line 30 of file QuectelPlan.h.

◆ COMMAND_TIMEOUT

constexpr std::chrono::milliseconds Quectel::Plan::COMMAND_TIMEOUT {1000}
inlineconstexpr

Per attempt, unless a command gives its own.

Definition at line 26 of file QuectelPlan.h.

◆ CONFIGURATION_TIMEOUT

constexpr std::chrono::milliseconds Quectel::Plan::CONFIGURATION_TIMEOUT {45000}
inlineconstexpr

For the whole configuration after validation.

Definition at line 28 of file QuectelPlan.h.

◆ FIX_INTERVAL_MS

constexpr unsigned Quectel::Plan::FIX_INTERVAL_MS = 1000
inlineconstexpr

Definition at line 44 of file QuectelPlan.h.

◆ FIXED_BASE_LABEL

constexpr std::string_view Quectel::Plan::FIXED_BASE_LABEL = "PQTMCFGSVIN,W (fixed position)"
inlineconstexpr

Labels for the base writes whose bodies carry ECEF coordinates.

Definition at line 54 of file QuectelPlan.h.

◆ IDENTIFY

constexpr std::string_view Quectel::Plan::IDENTIFY = "PQTMVERNO"
inlineconstexpr

Firmware identity: "PQTMVERNO,<firmware>,<date>,<time>". Only LG290P(03) firmware is qualified; LG580P and LG680P use the same commands.

Definition at line 34 of file QuectelPlan.h.

◆ MAXIMUM_SURVEY_ACCURACY_METERS

constexpr double Quectel::Plan::MAXIMUM_SURVEY_ACCURACY_METERS = 1000
inlineconstexpr

Definition at line 50 of file QuectelPlan.h.

◆ MAXIMUM_SURVEY_DURATION

constexpr std::chrono::hours Quectel::Plan::MAXIMUM_SURVEY_DURATION {24}
inlineconstexpr

Definition at line 49 of file QuectelPlan.h.

◆ NMEA_OUTPUT

constexpr std::array Quectel::Plan::NMEA_OUTPUT
inlineconstexpr
Initial value:
{
MessageRate{.message = "GGA"},
MessageRate{.message = "GST"},
MessageRate{.message = "GSA"},
MessageRate{.message = "GSV"},
}

NMEA output: position, position accuracy, satellites used and satellites in view, every second.

Definition at line 85 of file QuectelPlan.h.

◆ QUALIFIED_FIRMWARE

constexpr std::string_view Quectel::Plan::QUALIFIED_FIRMWARE = "LG290P03"
inlineconstexpr

Definition at line 35 of file QuectelPlan.h.

◆ READ_BASE

constexpr std::string_view Quectel::Plan::READ_BASE = "PQTMCFGSVIN,R"
inlineconstexpr

Base mode: "PQTMCFGSVIN,OK,<mode>,<observations>,<accuracy>,<x>,<y>,<z>[,<distance>]", with mode 1 survey-in and 2 fixed ECEF coordinates. Survey-in counts accepted 1 Hz fixes; its accuracy threshold filters each 3D fix.

Definition at line 48 of file QuectelPlan.h.

◆ READ_FIX_RATE

constexpr std::string_view Quectel::Plan::READ_FIX_RATE = "PQTMCFGFIXRATE,R"
inlineconstexpr

Base positioning runs at 1 Hz: "PQTMCFGFIXRATE,OK,1000".

Definition at line 43 of file QuectelPlan.h.

◆ READ_ROLE

constexpr std::string_view Quectel::Plan::READ_ROLE = "PQTMCFGRCVRMODE,R"
inlineconstexpr

Receiver role: "PQTMCFGRCVRMODE,OK,<role>", where 2 is the base station.

Definition at line 38 of file QuectelPlan.h.

◆ RESTART

constexpr std::string_view Quectel::Plan::RESTART = "PQTMSRR"
inlineconstexpr

Restarts without an acknowledgement. The identity is queried every RESTART_POLL, for up to RESTART_IDENTIFY_TIMEOUT, until it answers after the boot banner "PQTMVER,1,MODULE,<firmware>,...". Then the role is read back. All of it within RESTART_TIMEOUT.

Definition at line 64 of file QuectelPlan.h.

◆ RESTART_IDENTIFY_TIMEOUT

constexpr std::chrono::milliseconds Quectel::Plan::RESTART_IDENTIFY_TIMEOUT {700}
inlineconstexpr

Definition at line 67 of file QuectelPlan.h.

◆ RESTART_POLL

constexpr std::chrono::milliseconds Quectel::Plan::RESTART_POLL {200}
inlineconstexpr

Definition at line 66 of file QuectelPlan.h.

◆ RESTART_SURVEY

constexpr std::string_view Quectel::Plan::RESTART_SURVEY = "PQTMCFGSVIN,W"
inlineconstexpr

Re-runs a survey with exactly the fields READ_BASE reported.

Definition at line 52 of file QuectelPlan.h.

◆ RESTART_SURVEY_LABEL

constexpr std::string_view Quectel::Plan::RESTART_SURVEY_LABEL = "PQTMCFGSVIN,W (survey restart)"
inlineconstexpr

Definition at line 55 of file QuectelPlan.h.

◆ RESTART_TIMEOUT

constexpr std::chrono::milliseconds Quectel::Plan::RESTART_TIMEOUT {8000}
inlineconstexpr

Definition at line 65 of file QuectelPlan.h.

◆ SAVE

constexpr std::string_view Quectel::Plan::SAVE = "PQTMSAVEPAR"
inlineconstexpr

Saves the current settings to flash.

Definition at line 58 of file QuectelPlan.h.

◆ SAVE_TIMEOUT

constexpr std::chrono::milliseconds Quectel::Plan::SAVE_TIMEOUT {5000}
inlineconstexpr

Definition at line 59 of file QuectelPlan.h.

◆ WRITE_BASE_ROLE

constexpr std::string_view Quectel::Plan::WRITE_BASE_ROLE = "PQTMCFGRCVRMODE,W,2"
inlineconstexpr

Definition at line 40 of file QuectelPlan.h.