QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
GPSDriver Class Reference

#include <GPSDriver.h>

Public Member Functions

 GPSDriver (GPSType type, GPSTransport &transport, const GPSReceiverConfig &config, GPSDriverSinks sinks)
 
 ~GPSDriver ()
 
 GPSDriver (const GPSDriver &)=delete
 
GPSDriveroperator= (const GPSDriver &)=delete
 
bool configure ()
 Create and configure the underlying driver. Returns false on failure.
 
int receive (unsigned timeoutMs)
 
int handleCallback (int type, void *data1, int data2)
 

Detailed Description

Facade over the px4-gpsdrivers library: selects and configures the receiver driver, bridges its callbacks to a GPSTransport plus the supplied sinks, and pumps its receive loop. Keeps all px4 headers and types out of callers.

Definition at line 56 of file GPSDriver.h.

Constructor & Destructor Documentation

◆ GPSDriver() [1/2]

GPSDriver::GPSDriver ( GPSType  type,
GPSTransport transport,
const GPSReceiverConfig config,
GPSDriverSinks  sinks 
)

Definition at line 27 of file GPSDriver.cc.

◆ ~GPSDriver()

GPSDriver::~GPSDriver ( )
default

◆ GPSDriver() [2/2]

GPSDriver::GPSDriver ( const GPSDriver )
delete

Member Function Documentation

◆ configure()

◆ handleCallback()

int GPSDriver::handleCallback ( int  type,
void *  data1,
int  data2 
)

Trampoline target for the px4 callback; type is a GPSCallbackType value. Public only so the file-local C callback can reach it — not for callers.

Definition at line 115 of file GPSDriver.cc.

References GPSSurveyInStatus::active, GPSSurveyInStatus::altitude, GPSSurveyInStatus::durationSecs, GPSSurveyInStatus::latitude, GPSSurveyInStatus::longitude, GPSSurveyInStatus::meanAccuracyMM, GPSDriverSinks::onRTCM, GPSDriverSinks::onSurveyIn, GPSTransport::read(), GPSTransport::setBaudrate(), GPSSurveyInStatus::valid, and GPSTransport::write().

◆ operator=()

GPSDriver & GPSDriver::operator= ( const GPSDriver )
delete

◆ receive()

int GPSDriver::receive ( unsigned  timeoutMs)

Pump one receive cycle, invoking the position/satellite sinks as data arrives. Returns the px4 bitset (<0 error, bit0 position, bit1 satellite), or <0 if not configured.

Definition at line 95 of file GPSDriver.cc.

References GPSDriverSinks::onPosition, and GPSDriverSinks::onSatelliteInfo.


The documentation for this class was generated from the following files: