INSTINCT Code Coverage Report


Directory: src/
File: util/Vendor/Ublox/UbloxTypes.cpp
Date: 2025-02-07 16:54:41
Exec Total Coverage
Lines: 204 444 45.9%
Functions: 5 8 62.5%
Branches: 367 1185 31.0%

Line Branch Exec Source
1 // This file is part of INSTINCT, the INS Toolkit for Integrated
2 // Navigation Concepts and Training by the Institute of Navigation of
3 // the University of Stuttgart, Germany.
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
9 #include "UbloxTypes.hpp"
10
11 16 NAV::vendor::ublox::UbxClass NAV::vendor::ublox::getMsgClassFromString(const std::string& className)
12 {
13
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 15 times.
16 if (className == "NAV") { return UbxClass::UBX_CLASS_NAV; }
14
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 14 times.
15 if (className == "RXM") { return UbxClass::UBX_CLASS_RXM; }
15
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 13 times.
14 if (className == "INF") { return UbxClass::UBX_CLASS_INF; }
16
2/2
✓ Branch 1 taken 2 times.
✓ Branch 2 taken 11 times.
13 if (className == "ACK") { return UbxClass::UBX_CLASS_ACK; }
17
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 10 times.
11 if (className == "CFG") { return UbxClass::UBX_CLASS_CFG; }
18
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 9 times.
10 if (className == "UPD") { return UbxClass::UBX_CLASS_UPD; }
19
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 8 times.
9 if (className == "MON") { return UbxClass::UBX_CLASS_MON; }
20
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 7 times.
8 if (className == "TIM") { return UbxClass::UBX_CLASS_TIM; }
21
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 6 times.
7 if (className == "ESF") { return UbxClass::UBX_CLASS_ESF; }
22
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 5 times.
6 if (className == "MGA") { return UbxClass::UBX_CLASS_MGA; }
23
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 4 times.
5 if (className == "LOG") { return UbxClass::UBX_CLASS_LOG; }
24
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 3 times.
4 if (className == "SEC") { return UbxClass::UBX_CLASS_SEC; }
25
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 2 times.
3 if (className == "HNR") { return UbxClass::UBX_CLASS_HNR; }
26
27 2 return static_cast<UbxClass>(NULL);
28 }
29
30 159 uint8_t NAV::vendor::ublox::getMsgIdFromString(NAV::vendor::ublox::UbxClass msgClass, const std::string& idName)
31 {
32
2/2
✓ Branch 0 taken 4 times.
✓ Branch 1 taken 155 times.
159 if (msgClass == UbxClass::UBX_CLASS_ACK)
33 {
34
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 3 times.
4 if (idName == "ACK") { return UbxAckMessages::UBX_ACK_ACK; }
35
1/2
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
3 if (idName == "NAK") { return UbxAckMessages::UBX_ACK_NAK; }
36 }
37
2/2
✓ Branch 0 taken 34 times.
✓ Branch 1 taken 121 times.
155 else if (msgClass == UbxClass::UBX_CLASS_CFG)
38 {
39
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 33 times.
34 if (idName == "ANT") { return UbxCfgMessages::UBX_CFG_ANT; }
40
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 32 times.
33 if (idName == "BATCH") { return UbxCfgMessages::UBX_CFG_BATCH; }
41
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 31 times.
32 if (idName == "CFG") { return UbxCfgMessages::UBX_CFG_CFG; }
42
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 30 times.
31 if (idName == "DAT") { return UbxCfgMessages::UBX_CFG_DAT; }
43
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 29 times.
30 if (idName == "DGNSS") { return UbxCfgMessages::UBX_CFG_DGNSS; }
44
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 28 times.
29 if (idName == "DOSC") { return UbxCfgMessages::UBX_CFG_DOSC; }
45
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 27 times.
28 if (idName == "ESRC") { return UbxCfgMessages::UBX_CFG_ESRC; }
46
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 26 times.
27 if (idName == "GEOFENCE") { return UbxCfgMessages::UBX_CFG_GEOFENCE; }
47
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 25 times.
26 if (idName == "GNSS") { return UbxCfgMessages::UBX_CFG_GNSS; }
48
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 24 times.
25 if (idName == "HNR") { return UbxCfgMessages::UBX_CFG_HNR; }
49
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 23 times.
24 if (idName == "INF") { return UbxCfgMessages::UBX_CFG_INF; }
50
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 22 times.
23 if (idName == "ITFM") { return UbxCfgMessages::UBX_CFG_ITFM; }
51
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 21 times.
22 if (idName == "LOGFILTER") { return UbxCfgMessages::UBX_CFG_LOGFILTER; }
52
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 20 times.
21 if (idName == "MSG") { return UbxCfgMessages::UBX_CFG_MSG; }
53
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 19 times.
20 if (idName == "NAV5") { return UbxCfgMessages::UBX_CFG_NAV5; }
54
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 18 times.
19 if (idName == "NAVX5") { return UbxCfgMessages::UBX_CFG_NAVX5; }
55
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 17 times.
18 if (idName == "NMEA") { return UbxCfgMessages::UBX_CFG_NMEA; }
56
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 16 times.
17 if (idName == "ODO") { return UbxCfgMessages::UBX_CFG_ODO; }
57
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 15 times.
16 if (idName == "PM2") { return UbxCfgMessages::UBX_CFG_PM2; }
58
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 14 times.
15 if (idName == "PMS") { return UbxCfgMessages::UBX_CFG_PMS; }
59
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 13 times.
14 if (idName == "PRT") { return UbxCfgMessages::UBX_CFG_PRT; }
60
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 12 times.
13 if (idName == "PWR") { return UbxCfgMessages::UBX_CFG_PWR; }
61
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 11 times.
12 if (idName == "RATE") { return UbxCfgMessages::UBX_CFG_RATE; }
62
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 10 times.
11 if (idName == "RINV") { return UbxCfgMessages::UBX_CFG_RINV; }
63
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 9 times.
10 if (idName == "RST") { return UbxCfgMessages::UBX_CFG_RST; }
64
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 8 times.
9 if (idName == "RXM") { return UbxCfgMessages::UBX_CFG_RXM; }
65
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 7 times.
8 if (idName == "SBAS") { return UbxCfgMessages::UBX_CFG_SBAS; }
66
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 6 times.
7 if (idName == "SLAS") { return UbxCfgMessages::UBX_CFG_SLAS; }
67
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 5 times.
6 if (idName == "SMGR") { return UbxCfgMessages::UBX_CFG_SMGR; }
68
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 4 times.
5 if (idName == "TMODE2") { return UbxCfgMessages::UBX_CFG_TMODE2; }
69
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 3 times.
4 if (idName == "TMODE3") { return UbxCfgMessages::UBX_CFG_TMODE3; }
70
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 2 times.
3 if (idName == "TP5") { return UbxCfgMessages::UBX_CFG_TP5; }
71
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 1 times.
2 if (idName == "TXSLOT") { return UbxCfgMessages::UBX_CFG_TXSLOT; }
72
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 if (idName == "USB") { return UbxCfgMessages::UBX_CFG_USB; }
73 }
74
2/2
✓ Branch 0 taken 4 times.
✓ Branch 1 taken 117 times.
121 else if (msgClass == UbxClass::UBX_CLASS_ESF)
75 {
76
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 3 times.
4 if (idName == "INS") { return UbxEsfMessages::UBX_ESF_INS; }
77
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 2 times.
3 if (idName == "MEAS") { return UbxEsfMessages::UBX_ESF_MEAS; }
78
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 1 times.
2 if (idName == "RAW") { return UbxEsfMessages::UBX_ESF_RAW; }
79
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 if (idName == "STATUS") { return UbxEsfMessages::UBX_ESF_STATUS; }
80 }
81
2/2
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 115 times.
117 else if (msgClass == UbxClass::UBX_CLASS_HNR)
82 {
83
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 1 times.
2 if (idName == "INS") { return UbxHnrMessages::UBX_HNR_INS; }
84
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 if (idName == "PVT") { return UbxHnrMessages::UBX_HNR_PVT; }
85 }
86
2/2
✓ Branch 0 taken 5 times.
✓ Branch 1 taken 110 times.
115 else if (msgClass == UbxClass::UBX_CLASS_INF)
87 {
88
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 4 times.
5 if (idName == "DEBUG") { return UbxInfMessages::UBX_INF_DEBUG; }
89
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 3 times.
4 if (idName == "ERROR") { return UbxInfMessages::UBX_INF_ERROR; }
90
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 2 times.
3 if (idName == "NOTICE") { return UbxInfMessages::UBX_INF_NOTICE; }
91
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 1 times.
2 if (idName == "TEST") { return UbxInfMessages::UBX_INF_TEST; }
92
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 if (idName == "WARNING") { return UbxInfMessages::UBX_INF_WARNING; }
93 }
94
2/2
✓ Branch 0 taken 11 times.
✓ Branch 1 taken 99 times.
110 else if (msgClass == UbxClass::UBX_CLASS_LOG)
95 {
96
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 10 times.
11 if (idName == "BATCH") { return UbxLogMessages::UBX_LOG_BATCH; }
97
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 9 times.
10 if (idName == "CREATE") { return UbxLogMessages::UBX_LOG_CREATE; }
98
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 8 times.
9 if (idName == "ERASE") { return UbxLogMessages::UBX_LOG_ERASE; }
99
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 7 times.
8 if (idName == "FINDTIME") { return UbxLogMessages::UBX_LOG_FINDTIME; }
100
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 6 times.
7 if (idName == "INFO") { return UbxLogMessages::UBX_LOG_INFO; }
101
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 5 times.
6 if (idName == "RETRIEVE") { return UbxLogMessages::UBX_LOG_RETRIEVE; }
102
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 4 times.
5 if (idName == "RETRIEVEBATCH") { return UbxLogMessages::UBX_LOG_RETRIEVEBATCH; }
103
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 3 times.
4 if (idName == "RETRIEVEPOS") { return UbxLogMessages::UBX_LOG_RETRIEVEPOS; }
104
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 2 times.
3 if (idName == "RETRIEVEPOSEXTRA") { return UbxLogMessages::UBX_LOG_RETRIEVEPOSEXTRA; }
105
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 1 times.
2 if (idName == "RETRIEVESTRING") { return UbxLogMessages::UBX_LOG_RETRIEVESTRING; }
106
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 if (idName == "STRING") { return UbxLogMessages::UBX_LOG_STRING; }
107 }
108
2/2
✓ Branch 0 taken 33 times.
✓ Branch 1 taken 66 times.
99 else if (msgClass == UbxClass::UBX_CLASS_MGA)
109 {
110
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 32 times.
33 if (idName == "ACK_DATA0") { return UbxMgaMessages::UBX_MGA_ACK_DATA0; }
111
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 31 times.
32 if (idName == "ANO") { return UbxMgaMessages::UBX_MGA_ANO; }
112
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 30 times.
31 if (idName == "BDS_ALM") { return UbxMgaMessages::UBX_MGA_BDS_ALM; }
113
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 29 times.
30 if (idName == "BDS_EPH") { return UbxMgaMessages::UBX_MGA_BDS_EPH; }
114
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 28 times.
29 if (idName == "BDS_HEALTH") { return UbxMgaMessages::UBX_MGA_BDS_HEALTH; }
115
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 27 times.
28 if (idName == "BDS_IONO") { return UbxMgaMessages::UBX_MGA_BDS_IONO; }
116
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 26 times.
27 if (idName == "BDS_UTC") { return UbxMgaMessages::UBX_MGA_BDS_UTC; }
117
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 25 times.
26 if (idName == "DBD") { return UbxMgaMessages::UBX_MGA_DBD; }
118
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 24 times.
25 if (idName == "FLASH_ACK") { return UbxMgaMessages::UBX_MGA_FLASH_ACK; }
119
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 23 times.
24 if (idName == "FLASH_DATA") { return UbxMgaMessages::UBX_MGA_FLASH_DATA; }
120
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 22 times.
23 if (idName == "FLASH_STOP") { return UbxMgaMessages::UBX_MGA_FLASH_STOP; }
121
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 21 times.
22 if (idName == "GAL_ALM") { return UbxMgaMessages::UBX_MGA_GAL_ALM; }
122
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 20 times.
21 if (idName == "GAL_EPH") { return UbxMgaMessages::UBX_MGA_GAL_EPH; }
123
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 19 times.
20 if (idName == "GAL_TIMEOFFSET") { return UbxMgaMessages::UBX_MGA_GAL_TIMEOFFSET; }
124
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 18 times.
19 if (idName == "GAL_UTC") { return UbxMgaMessages::UBX_MGA_GAL_UTC; }
125
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 17 times.
18 if (idName == "GLO_ALM") { return UbxMgaMessages::UBX_MGA_GLO_ALM; }
126
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 16 times.
17 if (idName == "GLO_EPH") { return UbxMgaMessages::UBX_MGA_GLO_EPH; }
127
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 15 times.
16 if (idName == "GLO_TIMEOFFSET") { return UbxMgaMessages::UBX_MGA_GLO_TIMEOFFSET; }
128
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 14 times.
15 if (idName == "GPS_ALM") { return UbxMgaMessages::UBX_MGA_GPS_ALM; }
129
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 13 times.
14 if (idName == "GPS_EPH") { return UbxMgaMessages::UBX_MGA_GPS_EPH; }
130
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 12 times.
13 if (idName == "GPS_HEALTH") { return UbxMgaMessages::UBX_MGA_GPS_HEALTH; }
131
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 11 times.
12 if (idName == "GPS_IONO") { return UbxMgaMessages::UBX_MGA_GPS_IONO; }
132
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 10 times.
11 if (idName == "GPS_UTC") { return UbxMgaMessages::UBX_MGA_GPS_UTC; }
133
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 9 times.
10 if (idName == "INI_CLKD") { return UbxMgaMessages::UBX_MGA_INI_CLKD; }
134
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 8 times.
9 if (idName == "INI_EOP") { return UbxMgaMessages::UBX_MGA_INI_EOP; }
135
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 7 times.
8 if (idName == "INI_FREQ") { return UbxMgaMessages::UBX_MGA_INI_FREQ; }
136
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 6 times.
7 if (idName == "INI_POS_LLH") { return UbxMgaMessages::UBX_MGA_INI_POS_LLH; }
137
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 5 times.
6 if (idName == "INI_POS_XYZ") { return UbxMgaMessages::UBX_MGA_INI_POS_XYZ; }
138
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 4 times.
5 if (idName == "INI_TIME_GNSS") { return UbxMgaMessages::UBX_MGA_INI_TIME_GNSS; }
139
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 3 times.
4 if (idName == "INI_TIME_UTC") { return UbxMgaMessages::UBX_MGA_INI_TIME_UTC; }
140
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 2 times.
3 if (idName == "QZSS_ALM") { return UbxMgaMessages::UBX_MGA_QZSS_ALM; }
141
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 1 times.
2 if (idName == "QZSS_EPH") { return UbxMgaMessages::UBX_MGA_QZSS_EPH; }
142
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 if (idName == "QZSS_HEALTH") { return UbxMgaMessages::UBX_MGA_QZSS_HEALTH; }
143 }
144
2/2
✓ Branch 0 taken 12 times.
✓ Branch 1 taken 54 times.
66 else if (msgClass == UbxClass::UBX_CLASS_MON)
145 {
146
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 11 times.
12 if (idName == "BATCH") { return UbxMonMessages::UBX_MON_BATCH; }
147
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 10 times.
11 if (idName == "GNSS") { return UbxMonMessages::UBX_MON_GNSS; }
148
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 9 times.
10 if (idName == "HW2") { return UbxMonMessages::UBX_MON_HW2; }
149
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 8 times.
9 if (idName == "HW") { return UbxMonMessages::UBX_MON_HW; }
150
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 7 times.
8 if (idName == "IO") { return UbxMonMessages::UBX_MON_IO; }
151
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 6 times.
7 if (idName == "MSGPP") { return UbxMonMessages::UBX_MON_MSGPP; }
152
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 5 times.
6 if (idName == "PATCH") { return UbxMonMessages::UBX_MON_PATCH; }
153
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 4 times.
5 if (idName == "RXBUFF") { return UbxMonMessages::UBX_MON_RXBUFF; }
154
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 3 times.
4 if (idName == "RXR") { return UbxMonMessages::UBX_MON_RXR; }
155
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 2 times.
3 if (idName == "SMGR") { return UbxMonMessages::UBX_MON_SMGR; }
156
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 1 times.
2 if (idName == "TXBUFF") { return UbxMonMessages::UBX_MON_TXBUFF; }
157
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 if (idName == "VER") { return UbxMonMessages::UBX_MON_VER; }
158 }
159
2/2
✓ Branch 0 taken 31 times.
✓ Branch 1 taken 23 times.
54 else if (msgClass == UbxClass::UBX_CLASS_NAV)
160 {
161
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 30 times.
31 if (idName == "AOPSTATUS") { return UbxNavMessages::UBX_NAV_AOPSTATUS; }
162
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 29 times.
30 if (idName == "ATT") { return UbxNavMessages::UBX_NAV_ATT; }
163
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 28 times.
29 if (idName == "CLOCK") { return UbxNavMessages::UBX_NAV_CLOCK; }
164
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 27 times.
28 if (idName == "DGPS") { return UbxNavMessages::UBX_NAV_DGPS; }
165
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 26 times.
27 if (idName == "DOP") { return UbxNavMessages::UBX_NAV_DOP; }
166
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 25 times.
26 if (idName == "EOE") { return UbxNavMessages::UBX_NAV_EOE; }
167
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 24 times.
25 if (idName == "GEOFENCE") { return UbxNavMessages::UBX_NAV_GEOFENCE; }
168
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 23 times.
24 if (idName == "HPPOSECEF") { return UbxNavMessages::UBX_NAV_HPPOSECEF; }
169
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 22 times.
23 if (idName == "HPPOSLLH") { return UbxNavMessages::UBX_NAV_HPPOSLLH; }
170
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 21 times.
22 if (idName == "ODO") { return UbxNavMessages::UBX_NAV_ODO; }
171
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 20 times.
21 if (idName == "ORB") { return UbxNavMessages::UBX_NAV_ORB; }
172
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 19 times.
20 if (idName == "POSECEF") { return UbxNavMessages::UBX_NAV_POSECEF; }
173
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 18 times.
19 if (idName == "POSLLH") { return UbxNavMessages::UBX_NAV_POSLLH; }
174
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 17 times.
18 if (idName == "PVT") { return UbxNavMessages::UBX_NAV_PVT; }
175
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 16 times.
17 if (idName == "RELPOSNED") { return UbxNavMessages::UBX_NAV_RELPOSNED; }
176
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 15 times.
16 if (idName == "RESETODO") { return UbxNavMessages::UBX_NAV_RESETODO; }
177
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 14 times.
15 if (idName == "SAT") { return UbxNavMessages::UBX_NAV_SAT; }
178
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 13 times.
14 if (idName == "SBAS") { return UbxNavMessages::UBX_NAV_SBAS; }
179
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 12 times.
13 if (idName == "SLAS") { return UbxNavMessages::UBX_NAV_SLAS; }
180
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 11 times.
12 if (idName == "SOL") { return UbxNavMessages::UBX_NAV_SOL; }
181
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 10 times.
11 if (idName == "STATUS") { return UbxNavMessages::UBX_NAV_STATUS; }
182
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 9 times.
10 if (idName == "SVIN") { return UbxNavMessages::UBX_NAV_SVIN; }
183
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 8 times.
9 if (idName == "SVINFO") { return UbxNavMessages::UBX_NAV_SVINFO; }
184
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 7 times.
8 if (idName == "TIMEBDS") { return UbxNavMessages::UBX_NAV_TIMEBDS; }
185
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 6 times.
7 if (idName == "TIMEGAL") { return UbxNavMessages::UBX_NAV_TIMEGAL; }
186
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 5 times.
6 if (idName == "TIMEGLO") { return UbxNavMessages::UBX_NAV_TIMEGLO; }
187
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 4 times.
5 if (idName == "TIMEGPS") { return UbxNavMessages::UBX_NAV_TIMEGPS; }
188
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 3 times.
4 if (idName == "TIMELS") { return UbxNavMessages::UBX_NAV_TIMELS; }
189
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 2 times.
3 if (idName == "TIMEUTC") { return UbxNavMessages::UBX_NAV_TIMEUTC; }
190
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 1 times.
2 if (idName == "VELECEF") { return UbxNavMessages::UBX_NAV_VELECEF; }
191
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 if (idName == "VELNED") { return UbxNavMessages::UBX_NAV_VELNED; }
192 }
193
2/2
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 15 times.
23 else if (msgClass == UbxClass::UBX_CLASS_RXM)
194 {
195
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 7 times.
8 if (idName == "IMES") { return UbxRxmMessages::UBX_RXM_IMES; }
196
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 6 times.
7 if (idName == "MEASX") { return UbxRxmMessages::UBX_RXM_MEASX; }
197
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 5 times.
6 if (idName == "PMREQ") { return UbxRxmMessages::UBX_RXM_PMREQ; }
198
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 4 times.
5 if (idName == "RAWX") { return UbxRxmMessages::UBX_RXM_RAWX; }
199
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 3 times.
4 if (idName == "RLM") { return UbxRxmMessages::UBX_RXM_RLM; }
200
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 2 times.
3 if (idName == "RTCM") { return UbxRxmMessages::UBX_RXM_RTCM; }
201
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 1 times.
2 if (idName == "SFRBX") { return UbxRxmMessages::UBX_RXM_SFRBX; }
202
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 if (idName == "SVSI") { return UbxRxmMessages::UBX_RXM_SVSI; }
203 }
204
2/2
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 14 times.
15 else if (msgClass == UbxClass::UBX_CLASS_SEC)
205 {
206
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 if (idName == "UNIQID") { return UbxSecMessages::UBX_SEC_UNIQID; }
207 }
208
2/2
✓ Branch 0 taken 9 times.
✓ Branch 1 taken 5 times.
14 else if (msgClass == UbxClass::UBX_CLASS_TIM)
209 {
210
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 8 times.
9 if (idName == "FCHG") { return UbxTimMessages::UBX_TIM_FCHG; }
211
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 7 times.
8 if (idName == "HOC") { return UbxTimMessages::UBX_TIM_HOC; }
212
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 6 times.
7 if (idName == "SMEAS") { return UbxTimMessages::UBX_TIM_SMEAS; }
213
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 5 times.
6 if (idName == "SVIN") { return UbxTimMessages::UBX_TIM_SVIN; }
214
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 4 times.
5 if (idName == "TM2") { return UbxTimMessages::UBX_TIM_TM2; }
215
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 3 times.
4 if (idName == "TOS") { return UbxTimMessages::UBX_TIM_TOS; }
216
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 2 times.
3 if (idName == "TP") { return UbxTimMessages::UBX_TIM_TP; }
217
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 1 times.
2 if (idName == "VCOCAL") { return UbxTimMessages::UBX_TIM_VCOCAL; }
218
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 if (idName == "VRFY") { return UbxTimMessages::UBX_TIM_VRFY; }
219 }
220
2/2
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 3 times.
5 else if (msgClass == UbxClass::UBX_CLASS_UPD)
221 {
222
2/2
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 1 times.
2 if (idName == "SOS") { return UbxUpdMessages::UBX_UPD_SOS; }
223 }
224
225 4 return UINT8_MAX;
226 }
227
228 std::string NAV::vendor::ublox::getStringFromMsgClass(UbxClass msgClass)
229 {
230 switch (msgClass)
231 {
232 case NAV::vendor::ublox::UBX_CLASS_NONE:
233 return "NONE";
234 case NAV::vendor::ublox::UBX_CLASS_NAV:
235 return "NAV";
236 case NAV::vendor::ublox::UBX_CLASS_RXM:
237 return "RXM";
238 case NAV::vendor::ublox::UBX_CLASS_INF:
239 return "INF";
240 case NAV::vendor::ublox::UBX_CLASS_ACK:
241 return "ACK";
242 case NAV::vendor::ublox::UBX_CLASS_CFG:
243 return "CFG";
244 case NAV::vendor::ublox::UBX_CLASS_UPD:
245 return "UPD";
246 case NAV::vendor::ublox::UBX_CLASS_MON:
247 return "MON";
248 case NAV::vendor::ublox::UBX_CLASS_TIM:
249 return "TIM";
250 case NAV::vendor::ublox::UBX_CLASS_ESF:
251 return "ESF";
252 case NAV::vendor::ublox::UBX_CLASS_MGA:
253 return "MGA";
254 case NAV::vendor::ublox::UBX_CLASS_LOG:
255 return "LOG";
256 case NAV::vendor::ublox::UBX_CLASS_SEC:
257 return "SEC";
258 case NAV::vendor::ublox::UBX_CLASS_HNR:
259 return "HNR";
260 default:
261 break;
262 }
263 return "UNDEFINED";
264 }
265 std::string NAV::vendor::ublox::getStringFromMsgId(UbxClass msgClass, uint8_t msgId)
266 {
267 if (msgClass == UbxClass::UBX_CLASS_ACK)
268 {
269 if (msgId == UbxAckMessages::UBX_ACK_ACK) { return "ACK"; }
270 if (msgId == UbxAckMessages::UBX_ACK_NAK) { return "NAK"; }
271 }
272 else if (msgClass == UbxClass::UBX_CLASS_CFG)
273 {
274 if (msgId == UbxCfgMessages::UBX_CFG_ANT) { return "ANT"; }
275 if (msgId == UbxCfgMessages::UBX_CFG_BATCH) { return "BATCH"; }
276 if (msgId == UbxCfgMessages::UBX_CFG_CFG) { return "CFG"; }
277 if (msgId == UbxCfgMessages::UBX_CFG_DAT) { return "DAT"; }
278 if (msgId == UbxCfgMessages::UBX_CFG_DGNSS) { return "DGNSS"; }
279 if (msgId == UbxCfgMessages::UBX_CFG_DOSC) { return "DOSC"; }
280 if (msgId == UbxCfgMessages::UBX_CFG_ESRC) { return "ESRC"; }
281 if (msgId == UbxCfgMessages::UBX_CFG_GEOFENCE) { return "GEOFENCE"; }
282 if (msgId == UbxCfgMessages::UBX_CFG_GNSS) { return "GNSS"; }
283 if (msgId == UbxCfgMessages::UBX_CFG_HNR) { return "HNR"; }
284 if (msgId == UbxCfgMessages::UBX_CFG_INF) { return "INF"; }
285 if (msgId == UbxCfgMessages::UBX_CFG_ITFM) { return "ITFM"; }
286 if (msgId == UbxCfgMessages::UBX_CFG_LOGFILTER) { return "LOGFILTER"; }
287 if (msgId == UbxCfgMessages::UBX_CFG_MSG) { return "MSG"; }
288 if (msgId == UbxCfgMessages::UBX_CFG_NAV5) { return "NAV5"; }
289 if (msgId == UbxCfgMessages::UBX_CFG_NAVX5) { return "NAVX5"; }
290 if (msgId == UbxCfgMessages::UBX_CFG_NMEA) { return "NMEA"; }
291 if (msgId == UbxCfgMessages::UBX_CFG_ODO) { return "ODO"; }
292 if (msgId == UbxCfgMessages::UBX_CFG_PM2) { return "PM2"; }
293 if (msgId == UbxCfgMessages::UBX_CFG_PMS) { return "PMS"; }
294 if (msgId == UbxCfgMessages::UBX_CFG_PRT) { return "PRT"; }
295 if (msgId == UbxCfgMessages::UBX_CFG_PWR) { return "PWR"; }
296 if (msgId == UbxCfgMessages::UBX_CFG_RATE) { return "RATE"; }
297 if (msgId == UbxCfgMessages::UBX_CFG_RINV) { return "RINV"; }
298 if (msgId == UbxCfgMessages::UBX_CFG_RST) { return "RST"; }
299 if (msgId == UbxCfgMessages::UBX_CFG_RXM) { return "RXM"; }
300 if (msgId == UbxCfgMessages::UBX_CFG_SBAS) { return "SBAS"; }
301 if (msgId == UbxCfgMessages::UBX_CFG_SLAS) { return "SLAS"; }
302 if (msgId == UbxCfgMessages::UBX_CFG_SMGR) { return "SMGR"; }
303 if (msgId == UbxCfgMessages::UBX_CFG_TMODE2) { return "TMODE2"; }
304 if (msgId == UbxCfgMessages::UBX_CFG_TMODE3) { return "TMODE3"; }
305 if (msgId == UbxCfgMessages::UBX_CFG_TP5) { return "TP5"; }
306 if (msgId == UbxCfgMessages::UBX_CFG_TXSLOT) { return "TXSLOT"; }
307 if (msgId == UbxCfgMessages::UBX_CFG_USB) { return "USB"; }
308 }
309 else if (msgClass == UbxClass::UBX_CLASS_ESF)
310 {
311 if (msgId == UbxEsfMessages::UBX_ESF_INS) { return "INS"; }
312 if (msgId == UbxEsfMessages::UBX_ESF_MEAS) { return "MEAS"; }
313 if (msgId == UbxEsfMessages::UBX_ESF_RAW) { return "RAW"; }
314 if (msgId == UbxEsfMessages::UBX_ESF_STATUS) { return "STATUS"; }
315 }
316 else if (msgClass == UbxClass::UBX_CLASS_HNR)
317 {
318 if (msgId == UbxHnrMessages::UBX_HNR_INS) { return "INS"; }
319 if (msgId == UbxHnrMessages::UBX_HNR_PVT) { return "PVT"; }
320 }
321 else if (msgClass == UbxClass::UBX_CLASS_INF)
322 {
323 if (msgId == UbxInfMessages::UBX_INF_DEBUG) { return "DEBUG"; }
324 if (msgId == UbxInfMessages::UBX_INF_ERROR) { return "ERROR"; }
325 if (msgId == UbxInfMessages::UBX_INF_NOTICE) { return "NOTICE"; }
326 if (msgId == UbxInfMessages::UBX_INF_TEST) { return "TEST"; }
327 if (msgId == UbxInfMessages::UBX_INF_WARNING) { return "WARNING"; }
328 }
329 else if (msgClass == UbxClass::UBX_CLASS_LOG)
330 {
331 if (msgId == UbxLogMessages::UBX_LOG_BATCH) { return "BATCH"; }
332 if (msgId == UbxLogMessages::UBX_LOG_CREATE) { return "CREATE"; }
333 if (msgId == UbxLogMessages::UBX_LOG_ERASE) { return "ERASE"; }
334 if (msgId == UbxLogMessages::UBX_LOG_FINDTIME) { return "FINDTIME"; }
335 if (msgId == UbxLogMessages::UBX_LOG_INFO) { return "INFO"; }
336 if (msgId == UbxLogMessages::UBX_LOG_RETRIEVE) { return "RETRIEVE"; }
337 if (msgId == UbxLogMessages::UBX_LOG_RETRIEVEBATCH) { return "RETRIEVEBATCH"; }
338 if (msgId == UbxLogMessages::UBX_LOG_RETRIEVEPOS) { return "RETRIEVEPOS"; }
339 if (msgId == UbxLogMessages::UBX_LOG_RETRIEVEPOSEXTRA) { return "RETRIEVEPOSEXTRA"; }
340 if (msgId == UbxLogMessages::UBX_LOG_RETRIEVESTRING) { return "RETRIEVESTRING"; }
341 if (msgId == UbxLogMessages::UBX_LOG_STRING) { return "STRING"; }
342 }
343 else if (msgClass == UbxClass::UBX_CLASS_MGA)
344 {
345 if (msgId == UbxMgaMessages::UBX_MGA_ACK_DATA0) { return "ACK_DATA0"; }
346 if (msgId == UbxMgaMessages::UBX_MGA_ANO) { return "ANO"; }
347 if (msgId == UbxMgaMessages::UBX_MGA_BDS_ALM) { return "BDS_ALM"; }
348 if (msgId == UbxMgaMessages::UBX_MGA_BDS_EPH) { return "BDS_EPH"; }
349 if (msgId == UbxMgaMessages::UBX_MGA_BDS_HEALTH) { return "BDS_HEALTH"; }
350 if (msgId == UbxMgaMessages::UBX_MGA_BDS_IONO) { return "BDS_IONO"; }
351 if (msgId == UbxMgaMessages::UBX_MGA_BDS_UTC) { return "BDS_UTC"; }
352 if (msgId == UbxMgaMessages::UBX_MGA_DBD) { return "DBD"; }
353 if (msgId == UbxMgaMessages::UBX_MGA_FLASH_ACK) { return "FLASH_ACK"; }
354 if (msgId == UbxMgaMessages::UBX_MGA_FLASH_DATA) { return "FLASH_DATA"; }
355 if (msgId == UbxMgaMessages::UBX_MGA_FLASH_STOP) { return "FLASH_STOP"; }
356 if (msgId == UbxMgaMessages::UBX_MGA_GAL_ALM) { return "GAL_ALM"; }
357 if (msgId == UbxMgaMessages::UBX_MGA_GAL_EPH) { return "GAL_EPH"; }
358 if (msgId == UbxMgaMessages::UBX_MGA_GAL_TIMEOFFSET) { return "GAL_TIMEOFFSET"; }
359 if (msgId == UbxMgaMessages::UBX_MGA_GAL_UTC) { return "GAL_UTC"; }
360 if (msgId == UbxMgaMessages::UBX_MGA_GLO_ALM) { return "GLO_ALM"; }
361 if (msgId == UbxMgaMessages::UBX_MGA_GLO_EPH) { return "GLO_EPH"; }
362 if (msgId == UbxMgaMessages::UBX_MGA_GLO_TIMEOFFSET) { return "GLO_TIMEOFFSET"; }
363 if (msgId == UbxMgaMessages::UBX_MGA_GPS_ALM) { return "GPS_ALM"; }
364 if (msgId == UbxMgaMessages::UBX_MGA_GPS_EPH) { return "GPS_EPH"; }
365 if (msgId == UbxMgaMessages::UBX_MGA_GPS_HEALTH) { return "GPS_HEALTH"; }
366 if (msgId == UbxMgaMessages::UBX_MGA_GPS_IONO) { return "GPS_IONO"; }
367 if (msgId == UbxMgaMessages::UBX_MGA_GPS_UTC) { return "GPS_UTC"; }
368 if (msgId == UbxMgaMessages::UBX_MGA_INI_CLKD) { return "INI_CLKD"; }
369 if (msgId == UbxMgaMessages::UBX_MGA_INI_EOP) { return "INI_EOP"; }
370 if (msgId == UbxMgaMessages::UBX_MGA_INI_FREQ) { return "INI_FREQ"; }
371 if (msgId == UbxMgaMessages::UBX_MGA_INI_POS_LLH) { return "INI_POS_LLH"; }
372 if (msgId == UbxMgaMessages::UBX_MGA_INI_POS_XYZ) { return "INI_POS_XYZ"; }
373 if (msgId == UbxMgaMessages::UBX_MGA_INI_TIME_GNSS) { return "INI_TIME_GNSS"; }
374 if (msgId == UbxMgaMessages::UBX_MGA_INI_TIME_UTC) { return "INI_TIME_UTC"; }
375 if (msgId == UbxMgaMessages::UBX_MGA_QZSS_ALM) { return "QZSS_ALM"; }
376 if (msgId == UbxMgaMessages::UBX_MGA_QZSS_EPH) { return "QZSS_EPH"; }
377 if (msgId == UbxMgaMessages::UBX_MGA_QZSS_HEALTH) { return "QZSS_HEALTH"; }
378 }
379 else if (msgClass == UbxClass::UBX_CLASS_MON)
380 {
381 if (msgId == UbxMonMessages::UBX_MON_BATCH) { return "BATCH"; }
382 if (msgId == UbxMonMessages::UBX_MON_GNSS) { return "GNSS"; }
383 if (msgId == UbxMonMessages::UBX_MON_HW2) { return "HW2"; }
384 if (msgId == UbxMonMessages::UBX_MON_HW) { return "HW"; }
385 if (msgId == UbxMonMessages::UBX_MON_IO) { return "IO"; }
386 if (msgId == UbxMonMessages::UBX_MON_MSGPP) { return "MSGPP"; }
387 if (msgId == UbxMonMessages::UBX_MON_PATCH) { return "PATCH"; }
388 if (msgId == UbxMonMessages::UBX_MON_RXBUFF) { return "RXBUFF"; }
389 if (msgId == UbxMonMessages::UBX_MON_RXR) { return "RXR"; }
390 if (msgId == UbxMonMessages::UBX_MON_SMGR) { return "SMGR"; }
391 if (msgId == UbxMonMessages::UBX_MON_TXBUFF) { return "TXBUFF"; }
392 if (msgId == UbxMonMessages::UBX_MON_VER) { return "VER"; }
393 }
394 else if (msgClass == UbxClass::UBX_CLASS_NAV)
395 {
396 if (msgId == UbxNavMessages::UBX_NAV_AOPSTATUS) { return "AOPSTATUS"; }
397 if (msgId == UbxNavMessages::UBX_NAV_ATT) { return "ATT"; }
398 if (msgId == UbxNavMessages::UBX_NAV_CLOCK) { return "CLOCK"; }
399 if (msgId == UbxNavMessages::UBX_NAV_DGPS) { return "DGPS"; }
400 if (msgId == UbxNavMessages::UBX_NAV_DOP) { return "DOP"; }
401 if (msgId == UbxNavMessages::UBX_NAV_EOE) { return "EOE"; }
402 if (msgId == UbxNavMessages::UBX_NAV_GEOFENCE) { return "GEOFENCE"; }
403 if (msgId == UbxNavMessages::UBX_NAV_HPPOSECEF) { return "HPPOSECEF"; }
404 if (msgId == UbxNavMessages::UBX_NAV_HPPOSLLH) { return "HPPOSLLH"; }
405 if (msgId == UbxNavMessages::UBX_NAV_ODO) { return "ODO"; }
406 if (msgId == UbxNavMessages::UBX_NAV_ORB) { return "ORB"; }
407 if (msgId == UbxNavMessages::UBX_NAV_POSECEF) { return "POSECEF"; }
408 if (msgId == UbxNavMessages::UBX_NAV_POSLLH) { return "POSLLH"; }
409 if (msgId == UbxNavMessages::UBX_NAV_PVT) { return "PVT"; }
410 if (msgId == UbxNavMessages::UBX_NAV_RELPOSNED) { return "RELPOSNED"; }
411 if (msgId == UbxNavMessages::UBX_NAV_RESETODO) { return "RESETODO"; }
412 if (msgId == UbxNavMessages::UBX_NAV_SAT) { return "SAT"; }
413 if (msgId == UbxNavMessages::UBX_NAV_SBAS) { return "SBAS"; }
414 if (msgId == UbxNavMessages::UBX_NAV_SLAS) { return "SLAS"; }
415 if (msgId == UbxNavMessages::UBX_NAV_SOL) { return "SOL"; }
416 if (msgId == UbxNavMessages::UBX_NAV_STATUS) { return "STATUS"; }
417 if (msgId == UbxNavMessages::UBX_NAV_SVIN) { return "SVIN"; }
418 if (msgId == UbxNavMessages::UBX_NAV_SVINFO) { return "SVINFO"; }
419 if (msgId == UbxNavMessages::UBX_NAV_TIMEBDS) { return "TIMEBDS"; }
420 if (msgId == UbxNavMessages::UBX_NAV_TIMEGAL) { return "TIMEGAL"; }
421 if (msgId == UbxNavMessages::UBX_NAV_TIMEGLO) { return "TIMEGLO"; }
422 if (msgId == UbxNavMessages::UBX_NAV_TIMEGPS) { return "TIMEGPS"; }
423 if (msgId == UbxNavMessages::UBX_NAV_TIMELS) { return "TIMELS"; }
424 if (msgId == UbxNavMessages::UBX_NAV_TIMEUTC) { return "TIMEUTC"; }
425 if (msgId == UbxNavMessages::UBX_NAV_VELECEF) { return "VELECEF"; }
426 if (msgId == UbxNavMessages::UBX_NAV_VELNED) { return "VELNED"; }
427 }
428 else if (msgClass == UbxClass::UBX_CLASS_RXM)
429 {
430 if (msgId == UbxRxmMessages::UBX_RXM_IMES) { return "IMES"; }
431 if (msgId == UbxRxmMessages::UBX_RXM_MEASX) { return "MEASX"; }
432 if (msgId == UbxRxmMessages::UBX_RXM_PMREQ) { return "PMREQ"; }
433 if (msgId == UbxRxmMessages::UBX_RXM_RAWX) { return "RAWX"; }
434 if (msgId == UbxRxmMessages::UBX_RXM_RLM) { return "RLM"; }
435 if (msgId == UbxRxmMessages::UBX_RXM_RTCM) { return "RTCM"; }
436 if (msgId == UbxRxmMessages::UBX_RXM_SFRBX) { return "SFRBX"; }
437 if (msgId == UbxRxmMessages::UBX_RXM_SVSI) { return "SVSI"; }
438 }
439 else if (msgClass == UbxClass::UBX_CLASS_SEC)
440 {
441 if (msgId == UbxSecMessages::UBX_SEC_UNIQID) { return "UNIQID"; }
442 }
443 else if (msgClass == UbxClass::UBX_CLASS_TIM)
444 {
445 if (msgId == UbxTimMessages::UBX_TIM_FCHG) { return "FCHG"; }
446 if (msgId == UbxTimMessages::UBX_TIM_HOC) { return "HOC"; }
447 if (msgId == UbxTimMessages::UBX_TIM_SMEAS) { return "SMEAS"; }
448 if (msgId == UbxTimMessages::UBX_TIM_SVIN) { return "SVIN"; }
449 if (msgId == UbxTimMessages::UBX_TIM_TM2) { return "TM2"; }
450 if (msgId == UbxTimMessages::UBX_TIM_TOS) { return "TOS"; }
451 if (msgId == UbxTimMessages::UBX_TIM_TP) { return "TP"; }
452 if (msgId == UbxTimMessages::UBX_TIM_VCOCAL) { return "VCOCAL"; }
453 if (msgId == UbxTimMessages::UBX_TIM_VRFY) { return "VRFY"; }
454 }
455 else if (msgClass == UbxClass::UBX_CLASS_UPD)
456 {
457 if (msgId == UbxUpdMessages::UBX_UPD_SOS) { return "SOS"; }
458 }
459
460 return "UNDEFINED";
461 }
462
463 2 uint8_t NAV::vendor::ublox::getMsgIdFromString(const std::string& className, const std::string& idName)
464 {
465 2 return getMsgIdFromString(getMsgClassFromString(className), idName);
466 }
467
468 207290 NAV::SatelliteSystem NAV::vendor::ublox::getSatSys(uint8_t gnssId)
469 {
470
2/8
✓ Branch 0 taken 104869 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 102421 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
207290 switch (gnssId)
471 {
472 104869 case 0:
473 104869 return GPS;
474 case 1:
475 return SBAS;
476 102421 case 2:
477 102421 return GAL;
478 case 3:
479 return BDS;
480 case 5:
481 return QZSS;
482 case 6:
483 return GLO;
484 case 7:
485 return IRNSS;
486 default:
487 return SatSys_None;
488 }
489 }
490
491 28669 NAV::Code NAV::vendor::ublox::getCode(uint8_t gnssId, uint8_t sigId)
492 {
493
2/2
✓ Branch 0 taken 14639 times.
✓ Branch 1 taken 14030 times.
28669 if (gnssId == 0) // GPS
494 {
495
3/4
✓ Branch 0 taken 7408 times.
✓ Branch 1 taken 7231 times.
✓ Branch 3 taken 7408 times.
✗ Branch 4 not taken.
14639 if (sigId == 0) { return Code::G1C; } // GPS L1C/A
496
1/4
✗ Branch 0 not taken.
✓ Branch 1 taken 7231 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
7231 if (sigId == 3) { return Code::G2L; } // GPS L2 CL
497
1/4
✗ Branch 0 not taken.
✓ Branch 1 taken 7231 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
7231 if (sigId == 4) { return Code::G2M; } // GPS L2 CM
498
1/4
✗ Branch 0 not taken.
✓ Branch 1 taken 7231 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
7231 if (sigId == 6) { return Code::G5I; } // GPS L5 I
499
2/4
✓ Branch 0 taken 7231 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 7231 times.
✗ Branch 4 not taken.
7231 if (sigId == 7) { return Code::G5X; } // GPS L5 Q
500 }
501
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 14030 times.
14030 else if (gnssId == 1) // SBAS
502 {
503 if (sigId == 0) { return Code::S1C; } // SBAS L1C/A
504 }
505
1/2
✓ Branch 0 taken 14030 times.
✗ Branch 1 not taken.
14030 else if (gnssId == 2) // Galileo
506 {
507
3/4
✓ Branch 0 taken 7076 times.
✓ Branch 1 taken 6954 times.
✓ Branch 3 taken 7076 times.
✗ Branch 4 not taken.
14030 if (sigId == 0) { return Code::E1X; } // Galileo E1 C
508
1/4
✗ Branch 0 not taken.
✓ Branch 1 taken 6954 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
6954 if (sigId == 1) { return Code::E1B; } // Galileo E1 B
509
1/4
✗ Branch 0 not taken.
✓ Branch 1 taken 6954 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
6954 if (sigId == 3) { return Code::E5I; } // Galileo E5 aI
510
2/4
✓ Branch 0 taken 6954 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 6954 times.
✗ Branch 4 not taken.
6954 if (sigId == 4) { return Code::E5X; } // Galileo E5 aQ
511 if (sigId == 5) { return Code::E7I; } // Galileo E5 bI
512 if (sigId == 6) { return Code::E7X; } // Galileo E5 bQ
513 }
514 else if (gnssId == 3) // Beidou
515 {
516 if (sigId == 0) { return Code::B2I; } // BeiDou B1I D1
517 if (sigId == 1) { return Code::B2X; } // BeiDou B1I D2
518 if (sigId == 2) { return Code::B7I; } // BeiDou B2I D1
519 if (sigId == 3) { return Code::B7X; } // BeiDou B2I D2
520 if (sigId == 5) { return Code::B1P; } // BeiDou B1 Cp (pilot)
521 if (sigId == 6) { return Code::B1D; } // BeiDou B1 Cd (data)
522 if (sigId == 7) { return Code::B5P; } // BeiDou B2 ap (pilot)
523 if (sigId == 8) { return Code::B5D; } // BeiDou B2 ad (data)
524 }
525 else if (gnssId == 5) // QZSS
526 {
527 if (sigId == 0) { return Code::J1C; } // QZSS L1C/A
528 if (sigId == 1) { return Code::J1S; } // QZSS L1S
529 if (sigId == 4) { return Code::J2S; } // QZSS L2 CM
530 if (sigId == 5) { return Code::J2L; } // QZSS L2 CL
531 if (sigId == 8) { return Code::J5D; } // QZSS L5 I
532 if (sigId == 9) { return Code::J5P; } // QZSS L5 Q
533 }
534 else if (gnssId == 6) // GLONASS
535 {
536 if (sigId == 0) { return Code::R1C; } // GLONASS L1 OF
537 if (sigId == 2) { return Code::R2C; } // GLONASS L2 OF
538 }
539 else if (gnssId == 7) // IRNSS
540 {
541 if (sigId == 0) { return Code::I5A; } // NavIC L5 A
542 }
543 return Code::None;
544 }
545
546 std::ostream& operator<<(std::ostream& os, const NAV::vendor::ublox::UbxClass& obj)
547 {
548 return os << fmt::format("{}", obj);
549 }
550