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

#include <RTCMParser.h>

Public Member Functions

 RTCMParser ()
 
void reset ()
 
void setWhitelist (const QVector< int > &ids)
 
bool isWhitelisted (uint16_t id) const
 
bool addByte (uint8_t byte)
 
uint8_t * message ()
 
uint16_t messageLength () const
 
uint16_t messageId () const
 
const uint8_t * crcBytes () const
 
bool validateCrc () const
 
QByteArray currentFrame () const
 
QByteArray extractValidFrames (const QByteArray &in, int *framesFound=nullptr, int *framesDropped=nullptr)
 

Static Public Member Functions

static uint32_t crc24q (const uint8_t *data, size_t len)
 

Static Public Attributes

static constexpr uint8_t kPreamble = 0xD3
 
static constexpr int kCrcSize = 3
 
static constexpr int kHeaderSize = 3
 

Detailed Description

Definition at line 9 of file RTCMParser.h.

Constructor & Destructor Documentation

◆ RTCMParser()

RTCMParser::RTCMParser ( )

Definition at line 3 of file RTCMParser.cc.

References reset().

Member Function Documentation

◆ addByte()

bool RTCMParser::addByte ( uint8_t  byte)

Definition at line 17 of file RTCMParser.cc.

References addByte(), kCrcSize, kHeaderSize, kPreamble, and reset().

Referenced by addByte(), and extractValidFrames().

◆ crc24q()

uint32_t RTCMParser::crc24q ( const uint8_t *  data,
size_t  len 
)
static

Definition at line 75 of file RTCMParser.cc.

Referenced by validateCrc().

◆ crcBytes()

const uint8_t * RTCMParser::crcBytes ( ) const
inline

Definition at line 29 of file RTCMParser.h.

◆ currentFrame()

QByteArray RTCMParser::currentFrame ( ) const

Bytes of the just-completed frame (header + payload + CRC). Valid only immediately after addByte() returned true, before the next reset().

Definition at line 103 of file RTCMParser.cc.

References kCrcSize, and kHeaderSize.

Referenced by extractValidFrames().

◆ extractValidFrames()

QByteArray RTCMParser::extractValidFrames ( const QByteArray &  in,
int *  framesFound = nullptr,
int *  framesDropped = nullptr 
)

Feed a buffer through the parser, carrying state across calls, and return the concatenation of every complete CRC-valid frame found. Whitelist filtering is NOT applied. Optionally reports frame counts for caller logging.

Definition at line 110 of file RTCMParser.cc.

References addByte(), currentFrame(), reset(), and validateCrc().

◆ isWhitelisted()

bool RTCMParser::isWhitelisted ( uint16_t  id) const
inline

Definition at line 19 of file RTCMParser.h.

◆ message()

uint8_t * RTCMParser::message ( )
inline

Definition at line 23 of file RTCMParser.h.

◆ messageId()

uint16_t RTCMParser::messageId ( ) const

Definition at line 67 of file RTCMParser.cc.

◆ messageLength()

uint16_t RTCMParser::messageLength ( ) const
inline

Definition at line 25 of file RTCMParser.h.

◆ reset()

void RTCMParser::reset ( )

Definition at line 8 of file RTCMParser.cc.

Referenced by addByte(), extractValidFrames(), RTCMParser(), and RTCMUdpInput::start().

◆ setWhitelist()

void RTCMParser::setWhitelist ( const QVector< int > &  ids)
inline

Definition at line 17 of file RTCMParser.h.

◆ validateCrc()

bool RTCMParser::validateCrc ( ) const

Definition at line 91 of file RTCMParser.cc.

References crc24q(), and kHeaderSize.

Referenced by extractValidFrames().

Member Data Documentation

◆ kCrcSize

constexpr int RTCMParser::kCrcSize = 3
staticconstexpr

Definition at line 31 of file RTCMParser.h.

Referenced by addByte(), and currentFrame().

◆ kHeaderSize

constexpr int RTCMParser::kHeaderSize = 3
staticconstexpr

Definition at line 32 of file RTCMParser.h.

Referenced by addByte(), currentFrame(), and validateCrc().

◆ kPreamble

constexpr uint8_t RTCMParser::kPreamble = 0xD3
staticconstexpr

Definition at line 12 of file RTCMParser.h.

Referenced by addByte().


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