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

#include <RTCMFramer.h>

Public Member Functions

void reset ()
 
bool addByte (uint8_t byte)
 
bool nextFrame ()
 
bool hasPartialFrame () const
 
std::span< const uint8_t > frame () const
 Complete candidate, including malformed headers; empty while incomplete.
 
uint16_t bufferedSize () const
 Retained suffix length, including bytes beyond the current candidate.
 
uint16_t payloadLength () const
 
uint16_t messageId () const
 
bool valid () const
 

Static Public Member Functions

static uint16_t frameMessageId (std::span< const uint8_t > bytes)
 Message number from a frame header; zero when the header is incomplete.
 
static bool isValidFrame (std::span< const uint8_t > bytes)
 
static bool isValidFrame (QByteArrayView bytes)
 

Static Public Attributes

static constexpr uint8_t PREAMBLE = 0xd3
 
static constexpr uint16_t HEADER_SIZE = 3
 
static constexpr uint16_t CRC_SIZE = 3
 
static constexpr uint16_t MAX_PAYLOAD_SIZE = 1023
 
static constexpr uint16_t MAX_FRAME_SIZE = HEADER_SIZE + MAX_PAYLOAD_SIZE + CRC_SIZE
 

Detailed Description

Bounded RTCM framing shared by receiver codecs and correction inputs. Drain nextFrame() after completion to recover buffered suffixes.

Definition at line 18 of file RTCMFramer.h.

Member Function Documentation

◆ addByte()

bool RTCMFramer::addByte ( uint8_t  byte)

Definition at line 21 of file RTCMFramer.cc.

References PREAMBLE.

Referenced by RTCMFrameDecoder::addByte().

◆ bufferedSize()

uint16_t RTCMFramer::bufferedSize ( ) const
inline

Retained suffix length, including bytes beyond the current candidate.

Definition at line 45 of file RTCMFramer.h.

◆ frame()

std::span< const uint8_t > RTCMFramer::frame ( ) const
inline

Complete candidate, including malformed headers; empty while incomplete.

Definition at line 42 of file RTCMFramer.h.

◆ frameMessageId()

static uint16_t RTCMFramer::frameMessageId ( std::span< const uint8_t >  bytes)
inlinestatic

Message number from a frame header; zero when the header is incomplete.

Definition at line 56 of file RTCMFramer.h.

References HEADER_SIZE, and PREAMBLE.

Referenced by messageId().

◆ hasPartialFrame()

bool RTCMFramer::hasPartialFrame ( ) const
inline

Definition at line 39 of file RTCMFramer.h.

◆ isValidFrame() [1/2]

static bool RTCMFramer::isValidFrame ( QByteArrayView  bytes)
inlinestatic

Definition at line 72 of file RTCMFramer.h.

References isValidFrame().

◆ isValidFrame() [2/2]

static bool RTCMFramer::isValidFrame ( std::span< const uint8_t >  bytes)
inlinestatic

Definition at line 63 of file RTCMFramer.h.

References QGC::crc24q(), CRC_SIZE, HEADER_SIZE, and PREAMBLE.

Referenced by isValidFrame().

◆ messageId()

uint16_t RTCMFramer::messageId ( ) const
inline

Definition at line 49 of file RTCMFramer.h.

References frameMessageId(), and payloadLength().

◆ nextFrame()

bool RTCMFramer::nextFrame ( )

Definition at line 31 of file RTCMFramer.cc.

Referenced by RTCMFrameDecoder::nextFrame().

◆ payloadLength()

uint16_t RTCMFramer::payloadLength ( ) const
inline

Definition at line 47 of file RTCMFramer.h.

Referenced by messageId().

◆ reset()

void RTCMFramer::reset ( )
inline

Definition at line 27 of file RTCMFramer.h.

Referenced by RTCMFrameDecoder::reset().

◆ valid()

bool RTCMFramer::valid ( ) const
inline

Definition at line 61 of file RTCMFramer.h.

Member Data Documentation

◆ CRC_SIZE

constexpr uint16_t RTCMFramer::CRC_SIZE = 3
staticconstexpr

Definition at line 23 of file RTCMFramer.h.

Referenced by isValidFrame().

◆ HEADER_SIZE

constexpr uint16_t RTCMFramer::HEADER_SIZE = 3
staticconstexpr

Definition at line 22 of file RTCMFramer.h.

Referenced by frameMessageId(), and isValidFrame().

◆ MAX_FRAME_SIZE

constexpr uint16_t RTCMFramer::MAX_FRAME_SIZE = HEADER_SIZE + MAX_PAYLOAD_SIZE + CRC_SIZE
staticconstexpr

Definition at line 25 of file RTCMFramer.h.

◆ MAX_PAYLOAD_SIZE

constexpr uint16_t RTCMFramer::MAX_PAYLOAD_SIZE = 1023
staticconstexpr

Definition at line 24 of file RTCMFramer.h.

◆ PREAMBLE

constexpr uint8_t RTCMFramer::PREAMBLE = 0xd3
staticconstexpr

Definition at line 21 of file RTCMFramer.h.

Referenced by addByte(), frameMessageId(), and isValidFrame().


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