rtcm_framer.cc File Reference

Detailed Description

RTCM 3 message framer.

Definition in file rtcm_framer.cc.

#include "rtcm_framer.h"
#include <cstring>
#include "point_one/fusion_engine/common/logging.h"

Go to the source code of this file.

Classes

class  HexPrintableIntegerInst< T >
 

Macros

#define P1_VMODULE_NAME   rtcm_framer
 

Functions

static uint32_t CRC24Hash (const uint8_t *data, size_t len)
 
static constexpr uint16_t EndianSwap16 (const uint8_t *num_ptr)
 
static constexpr uint32_t EndianSwap24 (const uint8_t *num_ptr)
 
template<typename T >
HexPrintableIntegerInst< T > HexPrintableInteger (T value)
 Wrap an integer so it will be output to a stream as its hex representation. More...
 
template<typename T >
p1_ostreamoperator<< (p1_ostream &stream, const HexPrintableIntegerInst< T > &obj)
 

Variables

static constexpr uint8_t RTCM3_PREAMBLE = 0xD3
 
static constexpr uint32_t RTCM_CRC24Q [256]
 
static constexpr size_t RTCM_CRC_BYTES = 3
 Qualcomm 24-bit CRC. More...
 
static constexpr size_t RTCM_HEADER_BYTES = 3
 Transport header: Preamble = 8 bits Reserved = 6 bits Message Length = 10 bits Variable Length Data Message (not counted) More...
 
static constexpr size_t RTCM_MAX_SIZE_BYTES
 
static constexpr size_t RTCM_OVERHEAD_BYTES
 

Macro Definition Documentation

◆ P1_VMODULE_NAME

#define P1_VMODULE_NAME   rtcm_framer

Definition at line 7 of file rtcm_framer.cc.

Function Documentation

◆ CRC24Hash()

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

Definition at line 80 of file rtcm_framer.cc.

◆ EndianSwap16()

static constexpr uint16_t EndianSwap16 ( const uint8_t *  num_ptr)
staticconstexpr

Definition at line 95 of file rtcm_framer.cc.

◆ EndianSwap24()

static constexpr uint32_t EndianSwap24 ( const uint8_t *  num_ptr)
staticconstexpr

Definition at line 100 of file rtcm_framer.cc.

◆ HexPrintableInteger()

template<typename T >
HexPrintableIntegerInst<T> HexPrintableInteger ( value)

Wrap an integer so it will be output to a stream as its hex representation.

For example:

std::cout << HexPrintableValue((int16_t)-255) << std::endl;
std::cout << HexPrintableValue((uint32_t)255) << std::endl;
std::cout << HexPrintableValue((uint8_t)48) << std::endl;

generates the following output:

0xff01
0x000000ff
0x30 ('0')
Template Parameters
TThe type of the value parameter (inferred implicitly).
Parameters
valueThe integer value to wrap.
Returns
The wrapped integer that can be used in an p1_ostream.

Definition at line 171 of file rtcm_framer.cc.

◆ operator<<()

template<typename T >
p1_ostream& operator<< ( p1_ostream stream,
const HexPrintableIntegerInst< T > &  obj 
)

Definition at line 119 of file rtcm_framer.cc.

Variable Documentation

◆ RTCM3_PREAMBLE

constexpr uint8_t RTCM3_PREAMBLE = 0xD3
staticconstexpr

Definition at line 21 of file rtcm_framer.cc.

◆ RTCM_CRC24Q

constexpr uint32_t RTCM_CRC24Q[256]
staticconstexpr

Definition at line 40 of file rtcm_framer.cc.

◆ RTCM_CRC_BYTES

constexpr size_t RTCM_CRC_BYTES = 3
staticconstexpr

Qualcomm 24-bit CRC.

Definition at line 32 of file rtcm_framer.cc.

◆ RTCM_HEADER_BYTES

constexpr size_t RTCM_HEADER_BYTES = 3
staticconstexpr

Transport header: Preamble = 8 bits Reserved = 6 bits Message Length = 10 bits Variable Length Data Message (not counted)

Definition at line 30 of file rtcm_framer.cc.

◆ RTCM_MAX_SIZE_BYTES

constexpr size_t RTCM_MAX_SIZE_BYTES
staticconstexpr
Initial value:

Definition at line 37 of file rtcm_framer.cc.

◆ RTCM_OVERHEAD_BYTES

constexpr size_t RTCM_OVERHEAD_BYTES
staticconstexpr
Initial value:

Definition at line 34 of file rtcm_framer.cc.

static constexpr size_t RTCM_HEADER_BYTES
Transport header: Preamble = 8 bits Reserved = 6 bits Message Length = 10 bits Variable Length Data M...
Definition: rtcm_framer.cc:30
static constexpr size_t RTCM_CRC_BYTES
Qualcomm 24-bit CRC.
Definition: rtcm_framer.cc:32