forked from berthubert/galmon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ubx.hh
32 lines (26 loc) · 1.42 KB
/
ubx.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#pragma once
#include <string>
#include <vector>
#include <cstdint>
uint16_t calcUbxChecksum(uint8_t ubxClass, uint8_t ubxType, std::basic_string_view<uint8_t> str);
std::basic_string<uint8_t> buildUbxMessage(uint8_t ubxClass, uint8_t ubxType, std::basic_string_view<uint8_t> str);
std::basic_string<uint8_t> buildUbxMessage(uint8_t ubxClass, uint8_t ubxType, const std::initializer_list<uint8_t>& str);
std::basic_string<uint8_t> getInavFromSFRBXMsg(std::basic_string_view<uint8_t> msg,
std::basic_string<uint8_t>& reserved1,
std::basic_string<uint8_t>& reserved2,
std::basic_string<uint8_t>& sar,
std::basic_string<uint8_t>& spare,
std::basic_string<uint8_t>& crc, uint8_t* ssp=0);
std::basic_string<uint8_t> getGPSFromSFRBXMsg(std::basic_string_view<uint8_t> msg);
std::basic_string<uint8_t> getGlonassFromSFRBXMsg(std::basic_string_view<uint8_t> msg);
std::basic_string<uint8_t> getBeidouFromSFRBXMsg(std::basic_string_view<uint8_t> msg);
std::basic_string<uint8_t> getSBASFromSFRBXMsg(std::basic_string_view<uint8_t> msg);
struct CRCMismatch{};
struct TrkSatStat
{
int gnss;
int sv;
double dopplerHz;
uint64_t tr;
};
std::vector<TrkSatStat> parseTrkMeas(std::basic_string_view<uint8_t> payload);