QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
GPSTransport Class Referenceabstract

#include <GPSTransport.h>

+ Inheritance diagram for GPSTransport:

Public Member Functions

virtual ~GPSTransport ()=default
 
virtual int read (uint8_t *buffer, int length, int timeoutMs)=0
 
virtual int write (const uint8_t *buffer, int length)=0
 Write length bytes. Returns bytes written, or -1 on error.
 
virtual bool setBaudrate (unsigned baudrate)=0
 Set the link baud rate. Returns true on success.
 

Detailed Description

Byte link the GPS driver reads and writes through (serial, TCP, ...). Implemented by the owner of the physical connection and consumed by GPSDriver, keeping the px4-gpsdrivers library decoupled from the concrete transport.

Definition at line 8 of file GPSTransport.h.

Constructor & Destructor Documentation

◆ ~GPSTransport()

virtual GPSTransport::~GPSTransport ( )
virtualdefault

Member Function Documentation

◆ read()

virtual int GPSTransport::read ( uint8_t *  buffer,
int  length,
int  timeoutMs 
)
pure virtual

Read up to length bytes into buffer, waiting up to timeoutMs. Returns bytes read, 0 on timeout, <0 on error.

Implemented in SerialGPSTransport.

Referenced by GPSDriver::handleCallback().

◆ setBaudrate()

virtual bool GPSTransport::setBaudrate ( unsigned  baudrate)
pure virtual

Set the link baud rate. Returns true on success.

Implemented in SerialGPSTransport.

Referenced by GPSDriver::handleCallback().

◆ write()

virtual int GPSTransport::write ( const uint8_t *  buffer,
int  length 
)
pure virtual

Write length bytes. Returns bytes written, or -1 on error.

Implemented in SerialGPSTransport.

Referenced by GPSDriver::handleCallback().


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