QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
UBX Namespace Reference

u-blox receivers over UBX: CFG-VALSET configuration from protocol 27, CFG-MSG and CFG-TMODE3 before it. More...

Namespaces

namespace  Cfg
namespace  MsgClass
namespace  Msg
namespace  Plan

Classes

struct  CfgKey
 A configuration key whose value is written and read as T. More...
struct  MsgOutKey
 A CFG-MSGOUT output rate key family, named by its I2C key. More...
struct  ConfigurationValue
class  ConfigurationValueCursor
 Reads only key/value entries; VALSET and VALGET validate their different headers separately. More...
struct  ConfigurationValues
 The values of one CFG-VALGET poll or response. More...
struct  CheckedValsetBatch
class  EpochAssembler
struct  MessageId
struct  Frame
 A received frame. Its views borrow the decoder's storage until the next consume(). More...
class  FrameDecoder
struct  NavHpposllh
struct  NavDop
struct  NavPvt
struct  NavStatus
struct  NavSvin
struct  NavSat
struct  NavSatSatellite
struct  NavSvinfo
struct  NavSvinfoChannel
struct  MonHw
 MON-HW of u-blox 7 and later; protocol 27 deprecates it for MON-RF. More...
struct  MonRfBlock
struct  MonRf
 MON-RF with its first RF block; F9P reports two blocks and X20 three. More...
struct  SecSig
 SEC-SIG header: v2 and v3 flags, or v1 jamFlags; the per-band groups that follow are not read. More...
struct  MonVer
struct  MonVerExtension
struct  Ack
 ACK-ACK and ACK-NAK. More...
struct  CfgPrt
struct  CfgRate
struct  CfgNav5
struct  CfgMsg
struct  CfgMsgRates
 A CFG-MSG poll reply: the message's output rate on each I/O port. More...
struct  CfgTmode3
struct  MessageSchema
struct  ReceiverProfile
struct  Identity
 Receiver identity from MON-VER. More...
class  Protocol
struct  Acknowledgement
struct  MessageRates
 The CFG-MSG output rates of one message on each I/O port, as a poll returns them. More...
class  ReceiverController
 Owns control-response correlation: decoding reports replies through accept(); only configuration opens requests. More...

Enumerations

enum class  MsgOutPort : uint32_t { UART1 = 1 , USB = 3 }
 A port's CFG-MSGOUT key is the family's I2C key id plus the port's offset. More...
enum class  Board : uint8_t {
  unknown = 0 , u_blox5 = 5 , u_blox6 = 6 , u_blox7 = 7 ,
  u_blox8 = 8 , u_blox9 = 9 , u_blox9_F9P_L1L2 = 10 , u_blox10 = 11 ,
  u_blox9_F9P_L1L5 = 12 , u_blox10_L1L5 = 13 , u_blox_X20 = 14
}

Functions

constexpr size_t cfgKeyValueBytes (uint32_t keyId)
 Value size in bytes from bits 28-30 of a configuration key id, or 0 for a reserved size.
template<typename T, uint32_t Id>
consteval CfgKey< T > cfgKey ()
 Builds every key below, so each one checks its value type against the size bits of its id.
constexpr unsigned configurationValueBytes (uint32_t key)
 Value width in bytes of key; 0 for reserved sizes and for 8-byte values, which QGC never reads or writes.
std::optional< ConfigurationValues > decodeConfigurationValues (std::span< const uint8_t > payload)
 Decodes a CFG-VALGET response (version 1, RAM layer) of at most ConfigurationValues::MAX_KEYS values.
QByteArray messageName (MessageId message)
 The name of message, such as "UBX-CFG-VALSET", or its class and id in hex when it has none.
constexpr std::span< const uint8_t > encodeFrame (MessageId message, std::span< const uint8_t > payload, std::span< uint8_t > out)
 Writes the frame of payload to the front of out.
double coordinateDegrees (int32_t value, int64_t limitDegrees)
double latitudeDegrees (int32_t value)
double longitudeDegrees (int32_t value)
template<typename T>
constexpr MessageSchema fixedSchema (int towOffset=-1)
template<typename Header, typename Block>
constexpr MessageSchema repeatedSchema (MessageId message, size_t maximumBlocks)
constexpr const MessageSchema * messageSchema (uint16_t message)
bool validPayload (uint16_t message, std::span< const uint8_t > payload, const MessageSchema *schema)
constexpr ReceiverProfile receiverProfile (Board board)
constexpr Board boardFromHardwareVersion (std::string_view hardwareVersion)
 The generation whose MON-VER hwVersion is hardwareVersion; unknown when none matches.

Variables

const GPSReceiverFamily FAMILY
constexpr std::pair< MessageId, std::string_view > MESSAGE_NAMES []
 Readable names of the messages above, as the interface description writes them.
constexpr uint8_t SYNC1 = 0xb5
constexpr uint8_t SYNC2 = 0x62
constexpr size_t HEADER_SIZE = 6
constexpr size_t FRAME_OVERHEAD = HEADER_SIZE + 2
 Header and checksum.
constexpr size_t MAX_PAYLOAD_SIZE = 4096
 The longest payload decoded.
constexpr size_t MAX_SKIPPED_PAYLOAD_SIZE = 8192
template<Wire::Record T>
constexpr size_t WIRE_SIZE = Wire::SIZE<T>
constexpr size_t MAX_CONTROL_PAYLOAD_SIZE = 328
constexpr float DOP_PER_UNIT = 0.01f
constexpr std::array MESSAGE_SCHEMAS
constexpr std::array RECEIVER_PROFILES

Detailed Description

u-blox receivers over UBX: CFG-VALSET configuration from protocol 27, CFG-MSG and CFG-TMODE3 before it.

UBX payload records with the fields QGC reads or writes. Records of decoded messages carry their message ID; bytes without a field are skipped on decode and zero on encode.

Enumeration Type Documentation

◆ Board

enum class UBX::Board : uint8_t
strong
Enumerator
unknown 
u_blox5 
u_blox6 
u_blox7 
u_blox8 
u_blox9 
u_blox9_F9P_L1L2 
u_blox10 
u_blox9_F9P_L1L5 
u_blox10_L1L5 
u_blox_X20 

Definition at line 16 of file UBXPlan.h.

◆ MsgOutPort

enum class UBX::MsgOutPort : uint32_t
strong

A port's CFG-MSGOUT key is the family's I2C key id plus the port's offset.

Enumerator
UART1 
USB 

Definition at line 51 of file UBXConfigKeys.h.

Function Documentation

◆ boardFromHardwareVersion()

Board UBX::boardFromHardwareVersion ( std::string_view hardwareVersion)
nodiscardconstexpr

The generation whose MON-VER hwVersion is hardwareVersion; unknown when none matches.

Definition at line 93 of file UBXPlan.h.

References RECEIVER_PROFILES, and unknown.

◆ cfgKey()

template<typename T, uint32_t Id>
CfgKey< T > UBX::cfgKey ( )
nodiscardconsteval

Builds every key below, so each one checks its value type against the size bits of its id.

Definition at line 44 of file UBXConfigKeys.h.

References cfgKeyValueBytes().

◆ cfgKeyValueBytes()

size_t UBX::cfgKeyValueBytes ( uint32_t keyId)
nodiscardconstexpr

Value size in bytes from bits 28-30 of a configuration key id, or 0 for a reserved size.

Definition at line 16 of file UBXConfigKeys.h.

Referenced by cfgKey(), and configurationValueBytes().

◆ configurationValueBytes()

unsigned UBX::configurationValueBytes ( uint32_t key)
nodiscardconstexpr

Value width in bytes of key; 0 for reserved sizes and for 8-byte values, which QGC never reads or writes.

Definition at line 191 of file UBXConfigKeys.h.

References cfgKeyValueBytes().

Referenced by UBX::CheckedValsetBatch< Capacity >::append(), and UBX::ConfigurationValueCursor::next().

◆ coordinateDegrees()

double UBX::coordinateDegrees ( int32_t value,
int64_t limitDegrees )
inlinenodiscard

Converts a 1e-7 degree coordinate; values beyond +/-limitDegrees come from a corrupt or uninitialised solution and are reported as unavailable (NaN).

Definition at line 412 of file UBXMessageSchema.h.

References GPSProtocolMath::degreesFromE7().

Referenced by latitudeDegrees(), and longitudeDegrees().

◆ decodeConfigurationValues()

std::optional< ConfigurationValues > UBX::decodeConfigurationValues ( std::span< const uint8_t > payload)
inlinenodiscard

Decodes a CFG-VALGET response (version 1, RAM layer) of at most ConfigurationValues::MAX_KEYS values.

Definition at line 254 of file UBXConfigKeys.h.

References UBX::ConfigurationValues::count, UBX::ConfigurationValueCursor::empty(), UBX::ConfigurationValueCursor::next(), and UBX::ConfigurationValues::values.

◆ encodeFrame()

std::span< const uint8_t > UBX::encodeFrame ( MessageId message,
std::span< const uint8_t > payload,
std::span< uint8_t > out )
nodiscardconstexpr

Writes the frame of payload to the front of out.

Returns
the frame, or empty when it does not fit.

Definition at line 130 of file UBXFrame.h.

References UBX::MessageId::cls, QGC::fletcher8(), FRAME_OVERHEAD, HEADER_SIZE, UBX::MessageId::id, MAX_PAYLOAD_SIZE, SYNC1, and SYNC2.

◆ fixedSchema()

template<typename T>
MessageSchema UBX::fixedSchema ( int towOffset = -1)
nodiscardconstexpr

Definition at line 440 of file UBXMessageSchema.h.

References WIRE_SIZE.

◆ latitudeDegrees()

double UBX::latitudeDegrees ( int32_t value)
inlinenodiscard

Definition at line 418 of file UBXMessageSchema.h.

References coordinateDegrees().

◆ longitudeDegrees()

double UBX::longitudeDegrees ( int32_t value)
inlinenodiscard

Definition at line 423 of file UBXMessageSchema.h.

References coordinateDegrees().

◆ messageName()

QByteArray UBX::messageName ( MessageId message)
inlinenodiscard

The name of message, such as "UBX-CFG-VALSET", or its class and id in hex when it has none.

Definition at line 104 of file UBXFrame.h.

References UBX::MessageId::cls, UBX::MessageId::id, MESSAGE_NAMES, and UBX::MessageId::value().

Referenced by UBX::Protocol::probe().

◆ messageSchema()

const MessageSchema * UBX::messageSchema ( uint16_t message)
nodiscardconstexpr

Definition at line 472 of file UBXMessageSchema.h.

References MESSAGE_SCHEMAS.

◆ receiverProfile()

ReceiverProfile UBX::receiverProfile ( Board board)
nodiscardconstexpr

Definition at line 82 of file UBXPlan.h.

References RECEIVER_PROFILES.

◆ repeatedSchema()

template<typename Header, typename Block>
MessageSchema UBX::repeatedSchema ( MessageId message,
size_t maximumBlocks )
nodiscardconstexpr

Definition at line 446 of file UBXMessageSchema.h.

References UBX::MessageId::value(), and WIRE_SIZE.

◆ validPayload()

bool UBX::validPayload ( uint16_t message,
std::span< const uint8_t > payload,
const MessageSchema * schema )
inlinenodiscard
Parameters
schemamessageSchema(message), which callers also need.

Definition at line 483 of file UBXMessageSchema.h.

References UBX::MessageSchema::maximum, UBX::MessageSchema::minimum, UBX::Msg::MON_RF, UBX::Msg::NAV_SAT, UBX::Msg::NAV_SVINFO, UBX::Msg::SEC_SIG, and UBX::MessageSchema::stride.

Variable Documentation

◆ DOP_PER_UNIT

float UBX::DOP_PER_UNIT = 0.01f
inlineconstexpr

Definition at line 408 of file UBXMessageSchema.h.

◆ FAMILY

const GPSReceiverFamily UBX::FAMILY
Initial value:
{
.type = GPSType::ublox,
.logCategory = &UBXProtocolLog,
.stream = {.framers = GPSFrameKind::UBX | GPSFrameKind::RTCM3, .enabled = GPSFrameKind::UBX},
.baudCandidates = Plan::BAUD_RATES,
.signature = &signature,
}
std::unique_ptr< GPSFamilyProtocol > gpsCreateProtocol()
The create of a family whose protocol is default-constructed: .create = &gpsCreateProtocol<Protocol>.
@ UBX
u-blox 0xB5 0x62 frames with a valid Fletcher checksum.
@ RTCM3
0xD3 frames with a valid CRC-24Q.
constexpr std::array BAUD_RATES
Probing order of the automatic baud detection.
Definition UBXPlan.h:124

Definition at line 704 of file UBXConfigurator.cc.

◆ FRAME_OVERHEAD

size_t UBX::FRAME_OVERHEAD = HEADER_SIZE + 2
inlineconstexpr

Header and checksum.

Definition at line 122 of file UBXFrame.h.

Referenced by encodeFrame().

◆ HEADER_SIZE

size_t UBX::HEADER_SIZE = 6
inlineconstexpr

Definition at line 120 of file UBXFrame.h.

Referenced by UBX::FrameDecoder::consume(), and encodeFrame().

◆ MAX_CONTROL_PAYLOAD_SIZE

size_t UBX::MAX_CONTROL_PAYLOAD_SIZE = 328
inlineconstexpr

Definition at line 407 of file UBXMessageSchema.h.

◆ MAX_PAYLOAD_SIZE

size_t UBX::MAX_PAYLOAD_SIZE = 4096
inlineconstexpr

The longest payload decoded.

Definition at line 124 of file UBXFrame.h.

Referenced by UBX::FrameDecoder::consume(), and encodeFrame().

◆ MAX_SKIPPED_PAYLOAD_SIZE

size_t UBX::MAX_SKIPPED_PAYLOAD_SIZE = 8192
inlineconstexpr

A longer payload, up to this size, is read to its end and dropped, so the stream stays aligned on the next frame. It covers every documented message, the largest being RXM-RAWX at 8176 bytes; a longer claim is taken as noise.

Definition at line 127 of file UBXFrame.h.

Referenced by UBX::FrameDecoder::consume().

◆ MESSAGE_NAMES

std::pair<MessageId, std::string_view> UBX::MESSAGE_NAMES[]
inlineconstexpr
Initial value:
= {
{Msg::NAV_STATUS, "UBX-NAV-STATUS"}, {Msg::NAV_DOP, "UBX-NAV-DOP"}, {Msg::NAV_PVT, "UBX-NAV-PVT"},
{Msg::NAV_HPPOSLLH, "UBX-NAV-HPPOSLLH"}, {Msg::NAV_TIMEGPS, "UBX-NAV-TIMEGPS"}, {Msg::NAV_SVINFO, "UBX-NAV-SVINFO"},
{Msg::NAV_SAT, "UBX-NAV-SAT"}, {Msg::NAV_SVIN, "UBX-NAV-SVIN"}, {Msg::NAV_EOE, "UBX-NAV-EOE"},
{Msg::RXM_SFRBX, "UBX-RXM-SFRBX"}, {Msg::RXM_RAWX, "UBX-RXM-RAWX"}, {Msg::INF_ERROR, "UBX-INF-ERROR"},
{Msg::INF_WARNING, "UBX-INF-WARNING"}, {Msg::INF_NOTICE, "UBX-INF-NOTICE"}, {Msg::INF_DEBUG, "UBX-INF-DEBUG"},
{Msg::ACK_NAK, "UBX-ACK-NAK"}, {Msg::ACK_ACK, "UBX-ACK-ACK"}, {Msg::CFG_PRT, "UBX-CFG-PRT"},
{Msg::CFG_MSG, "UBX-CFG-MSG"}, {Msg::CFG_RATE, "UBX-CFG-RATE"}, {Msg::CFG_NAV5, "UBX-CFG-NAV5"},
{Msg::CFG_TMODE3, "UBX-CFG-TMODE3"}, {Msg::CFG_VALSET, "UBX-CFG-VALSET"}, {Msg::CFG_VALGET, "UBX-CFG-VALGET"},
{Msg::MON_VER, "UBX-MON-VER"}, {Msg::MON_HW, "UBX-MON-HW"}, {Msg::MON_RF, "UBX-MON-RF"},
{Msg::SEC_SIG, "UBX-SEC-SIG"}, {Msg::RTCM3_1005, "RTCM3-1005"}, {Msg::RTCM3_1074, "RTCM3-1074"},
{Msg::RTCM3_1077, "RTCM3-1077"}, {Msg::RTCM3_1084, "RTCM3-1084"}, {Msg::RTCM3_1087, "RTCM3-1087"},
{Msg::RTCM3_1094, "RTCM3-1094"}, {Msg::RTCM3_1097, "RTCM3-1097"}, {Msg::RTCM3_1124, "RTCM3-1124"},
{Msg::RTCM3_1127, "RTCM3-1127"}, {Msg::RTCM3_1230, "RTCM3-1230"},
}
constexpr MessageId CFG_VALSET
Definition UBXFrame.h:66
constexpr MessageId NAV_SVIN
Definition UBXFrame.h:51
constexpr MessageId ACK_NAK
Definition UBXFrame.h:59
constexpr MessageId RTCM3_1074
Definition UBXFrame.h:73
constexpr MessageId MON_HW
Definition UBXFrame.h:69
constexpr MessageId INF_DEBUG
Definition UBXFrame.h:58
constexpr MessageId MON_RF
Definition UBXFrame.h:70
constexpr MessageId SEC_SIG
Definition UBXFrame.h:71
constexpr MessageId RTCM3_1124
Definition UBXFrame.h:79
constexpr MessageId NAV_EOE
Definition UBXFrame.h:52
constexpr MessageId RTCM3_1077
Definition UBXFrame.h:74
constexpr MessageId ACK_ACK
Definition UBXFrame.h:60
constexpr MessageId RTCM3_1127
Definition UBXFrame.h:80
constexpr MessageId NAV_STATUS
Definition UBXFrame.h:44
constexpr MessageId NAV_DOP
Definition UBXFrame.h:45
constexpr MessageId RTCM3_1097
Definition UBXFrame.h:78
constexpr MessageId RXM_SFRBX
Definition UBXFrame.h:53
constexpr MessageId RTCM3_1230
Definition UBXFrame.h:81
constexpr MessageId NAV_TIMEGPS
Definition UBXFrame.h:48
constexpr MessageId CFG_VALGET
Definition UBXFrame.h:67
constexpr MessageId CFG_RATE
Definition UBXFrame.h:63
constexpr MessageId RXM_RAWX
Definition UBXFrame.h:54
constexpr MessageId NAV_SAT
Definition UBXFrame.h:50
constexpr MessageId MON_VER
Definition UBXFrame.h:68
constexpr MessageId RTCM3_1087
Definition UBXFrame.h:76
constexpr MessageId NAV_SVINFO
Definition UBXFrame.h:49
constexpr MessageId RTCM3_1005
Definition UBXFrame.h:72
constexpr MessageId INF_WARNING
Definition UBXFrame.h:56
constexpr MessageId CFG_MSG
Definition UBXFrame.h:62
constexpr MessageId CFG_NAV5
Definition UBXFrame.h:64
constexpr MessageId INF_ERROR
Definition UBXFrame.h:55
constexpr MessageId CFG_TMODE3
Definition UBXFrame.h:65
constexpr MessageId INF_NOTICE
Definition UBXFrame.h:57
constexpr MessageId NAV_HPPOSLLH
Definition UBXFrame.h:47
constexpr MessageId RTCM3_1084
Definition UBXFrame.h:75
constexpr MessageId NAV_PVT
Definition UBXFrame.h:46
constexpr MessageId RTCM3_1094
Definition UBXFrame.h:77
constexpr MessageId CFG_PRT
Definition UBXFrame.h:61

Readable names of the messages above, as the interface description writes them.

Definition at line 87 of file UBXFrame.h.

Referenced by messageName().

◆ MESSAGE_SCHEMAS

std::array UBX::MESSAGE_SCHEMAS
inlineconstexpr

◆ RECEIVER_PROFILES

std::array UBX::RECEIVER_PROFILES
inlineconstexpr
Initial value:
= {
ReceiverProfile{.board = Board::u_blox5, .hardwareVersion = "00040005", .baseCapabilityKnown = true},
ReceiverProfile{.board = Board::u_blox6, .hardwareVersion = "00040007", .baseCapabilityKnown = true},
ReceiverProfile{.board = Board::u_blox7, .hardwareVersion = "00070000", .baseCapabilityKnown = true},
ReceiverProfile{.board = Board::u_blox8, .hardwareVersion = "00080000"},
.board = Board::u_blox9, .hardwareVersion = "00190000", .baseCapabilityKnown = true, .protocol27 = true},
.rtcmOutput = true,
.baseCapabilityKnown = true,
.measurementPeriodMs = 200,
.protocol27 = true},
.board = Board::u_blox10, .hardwareVersion = "000A0000", .baseCapabilityKnown = true, .protocol27 = true},
.rtcmOutput = true,
.baseCapabilityKnown = true,
.l5HealthOverride = true,
.measurementPeriodMs = 200,
.protocol27 = true},
ReceiverProfile{.board = Board::u_blox10_L1L5, .baseCapabilityKnown = true, .protocol27 = true},
.hardwareVersion = "000B0000",
.rtcmOutput = true,
.baseCapabilityKnown = true,
.l5HealthOverride = true,
.protocol27 = true},
}
@ u_blox_X20
Definition UBXPlan.h:28
@ u_blox10_L1L5
Definition UBXPlan.h:27
@ u_blox9_F9P_L1L5
Definition UBXPlan.h:26
@ u_blox9_F9P_L1L2
Definition UBXPlan.h:24

Definition at line 51 of file UBXPlan.h.

Referenced by boardFromHardwareVersion(), and receiverProfile().

◆ SYNC1

uint8_t UBX::SYNC1 = 0xb5
inlineconstexpr

Definition at line 118 of file UBXFrame.h.

Referenced by UBX::FrameDecoder::consume(), and encodeFrame().

◆ SYNC2

uint8_t UBX::SYNC2 = 0x62
inlineconstexpr

Definition at line 119 of file UBXFrame.h.

Referenced by UBX::FrameDecoder::consume(), and encodeFrame().

◆ WIRE_SIZE

template<Wire::Record T>
size_t UBX::WIRE_SIZE = Wire::SIZE<T>
inlineconstexpr

Definition at line 405 of file UBXMessageSchema.h.

Referenced by fixedSchema(), and repeatedSchema().