17inline constexpr uint8_t
SYNC1 = 0x24;
18inline constexpr uint8_t
SYNC2 = 0x40;
29 [[nodiscard]]
constexpr uint16_t
number()
const {
return static_cast<uint16_t
>(
id & 0x1fff); }
59 [[nodiscard]]
constexpr uint8_t
modeType()
const {
return static_cast<uint8_t
>(
mode & 0x0f); }
63 [[nodiscard]]
constexpr bool mode2D()
const {
return (
mode & 0x80) != 0; }
73 static constexpr size_t SIZE = 8;
74 static constexpr auto FIELDS =
82 static constexpr size_t SIZE = 94;
83 static constexpr auto FIELDS = std::tuple{
91static_assert(Wire::VALID_LAYOUT<SBF::BlockHeader>);
92static_assert(Wire::VALID_LAYOUT<SBF::PVTGeodetic>);
97[[nodiscard]]
inline std::optional<BlockHeader>
checkedHeader(std::span<const uint8_t> block)
100 constexpr size_t CRC_START = 4;
101 if (block.size() < Wire::SIZE<BlockHeader>) {
104 const auto header = Wire::decode<BlockHeader>(block);
105 if (header.length < Wire::SIZE<BlockHeader> || header.length > block.size() ||
106 header.crc !=
QGC::crc16Xmodem(block.subspan(CRC_START, header.length - CRC_START))) {
constexpr uint16_t crc16Xmodem(std::span< const uint8_t > bytes)
CRC-16/XMODEM: polynomial 0x1021, initial value 0, no reflection and no final XOR.
constexpr uint16_t PVT_GEODETIC
Septentrio receivers configured as RTK bases with SBF commands; they stream PVTGeodetic blocks and RT...
std::optional< BlockHeader > checkedHeader(std::span< const uint8_t > block)
The header of a block candidate whose length fits the candidate and whose CRC matches; nullopt otherw...
constexpr std::size_t SIZE
constexpr bool modeAutoSet() const
constexpr bool mode2D() const
constexpr uint8_t modeType() const