Skip to content

Commit 74f5260

Browse files
committed
Add common settings tCmnCnst, tCmnRtNm, tCnRtRtB, tCnRtRtR
@nseidle - I know you're going to hate this, but I honestly can't think of a better way to solve the issue. Please see the notes in `settings.h` `rtkSettingsEntries` for more details.
1 parent 414c1f5 commit 74f5260

File tree

3 files changed

+343
-192
lines changed

3 files changed

+343
-192
lines changed

Firmware/RTK_Everywhere/NVM.ino

Lines changed: 144 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,15 @@ void recordSystemSettingsToFile(File *settingsFile)
326326
}
327327
break;
328328

329+
case tCmnCnst:
330+
break; // Nothing to do here. Let each GNSS add its settings
331+
case tCmnRtNm:
332+
break; // Nothing to do here. Let each GNSS add its settings
333+
case tCnRtRtB:
334+
break; // Nothing to do here. Let each GNSS add its settings
335+
case tCnRtRtR:
336+
break; // Nothing to do here. Let each GNSS add its settings
337+
329338
case tEspNowPr: {
330339
// Record ESP-Now peer MAC addresses
331340
for (int x = 0; x < rtkSettingsEntries[i].qualifier; x++)
@@ -1089,8 +1098,6 @@ bool parseLine(char *str)
10891098
RTK_Settings_Types type;
10901099
void *var;
10911100

1092-
double settingValue;
1093-
10941101
// Loop through the valid command entries
10951102
i = commandLookupSettingName(false, settingName, truncatedName, sizeof(truncatedName), suffix, sizeof(suffix));
10961103

@@ -1215,9 +1222,21 @@ bool parseLine(char *str)
12151222
}
12161223
break;
12171224

1225+
case tCmnCnst: {
1226+
#ifdef COMPILE_MOSAICX5
1227+
for (int x = 0; x < MAX_MOSAIC_CONSTELLATIONS; x++)
1228+
{
1229+
if ((suffix[0] == mosaicSignalConstellations[x].configName[0]) &&
1230+
(strcmp(suffix, mosaicSignalConstellations[x].configName) == 0))
1231+
{
1232+
settings.mosaicConstellations[x] = d;
1233+
knownSetting = true;
1234+
break;
1235+
}
1236+
}
1237+
#endif
12181238
#ifdef COMPILE_ZED
1219-
case tUbxConst: {
1220-
for (int x = 0; x < qualifier; x++)
1239+
for (int x = 0; x < MAX_UBX_CONSTELLATIONS; x++)
12211240
{
12221241
if ((suffix[0] == settings.ubxConstellations[x].textName[0]) &&
12231242
(strcmp(suffix, settings.ubxConstellations[x].textName) == 0))
@@ -1227,6 +1246,118 @@ bool parseLine(char *str)
12271246
break;
12281247
}
12291248
}
1249+
#endif
1250+
#ifdef COMPILE_UM980
1251+
for (int x = 0; x < MAX_UM980_CONSTELLATIONS; x++)
1252+
{
1253+
if ((suffix[0] == um980ConstellationCommands[x].textName[0]) &&
1254+
(strcmp(suffix, um980ConstellationCommands[x].textName) == 0))
1255+
{
1256+
settings.um980Constellations[x] = d;
1257+
knownSetting = true;
1258+
break;
1259+
}
1260+
}
1261+
#endif
1262+
#ifdef COMPILE_LG290P
1263+
for (int x = 0; x < MAX_LG290P_CONSTELLATIONS; x++)
1264+
{
1265+
if ((suffix[0] == lg290pConstellationNames[x][0]) &&
1266+
(strcmp(suffix, lg290pConstellationNames[x]) == 0))
1267+
{
1268+
settings.lg290pConstellations[x] = d;
1269+
knownSetting = true;
1270+
break;
1271+
}
1272+
}
1273+
#endif // COMPILE_LG290P
1274+
}
1275+
break;
1276+
case tCmnRtNm: {
1277+
#ifdef COMPILE_UM980
1278+
for (int x = 0; x < MAX_UM980_NMEA_MSG; x++)
1279+
{
1280+
if ((suffix[0] == umMessagesNMEA[x].msgTextName[0]) &&
1281+
(strcmp(suffix, umMessagesNMEA[x].msgTextName) == 0))
1282+
{
1283+
settings.um980MessageRatesNMEA[x] = d;
1284+
knownSetting = true;
1285+
break;
1286+
}
1287+
}
1288+
#endif
1289+
#ifdef COMPILE_LG290P
1290+
for (int x = 0; x < MAX_LG290P_NMEA_MSG; x++)
1291+
{
1292+
if ((suffix[0] == lgMessagesNMEA[x].msgTextName[0]) &&
1293+
(strcmp(suffix, lgMessagesNMEA[x].msgTextName) == 0))
1294+
{
1295+
settings.lg290pMessageRatesNMEA[x] = d;
1296+
knownSetting = true;
1297+
break;
1298+
}
1299+
}
1300+
}
1301+
#endif
1302+
break;
1303+
case tCnRtRtB: {
1304+
#ifdef COMPILE_UM980
1305+
for (int x = 0; x < MAX_UM980_RTCM_MSG; x++)
1306+
{
1307+
if ((suffix[0] == umMessagesRTCM[x].msgTextName[0]) &&
1308+
(strcmp(suffix, umMessagesRTCM[x].msgTextName) == 0))
1309+
{
1310+
settings.um980MessageRatesRTCMBase[x] = d;
1311+
knownSetting = true;
1312+
break;
1313+
}
1314+
}
1315+
#endif
1316+
#ifdef COMPILE_LG290P
1317+
for (int x = 0; x < MAX_LG290P_RTCM_MSG; x++)
1318+
{
1319+
if ((suffix[0] == lgMessagesRTCM[x].msgTextName[0]) &&
1320+
(strcmp(suffix, lgMessagesRTCM[x].msgTextName) == 0))
1321+
{
1322+
settings.lg290pMessageRatesRTCMBase[x] = d;
1323+
knownSetting = true;
1324+
break;
1325+
}
1326+
}
1327+
}
1328+
#endif
1329+
break;
1330+
case tCnRtRtR: {
1331+
#ifdef COMPILE_UM980
1332+
for (int x = 0; x < MAX_UM980_RTCM_MSG; x++)
1333+
{
1334+
if ((suffix[0] == umMessagesRTCM[x].msgTextName[0]) &&
1335+
(strcmp(suffix, umMessagesRTCM[x].msgTextName) == 0))
1336+
{
1337+
settings.um980MessageRatesRTCMRover[x] = d;
1338+
knownSetting = true;
1339+
break;
1340+
}
1341+
}
1342+
#endif
1343+
#ifdef COMPILE_LG290P
1344+
for (int x = 0; x < MAX_LG290P_RTCM_MSG; x++)
1345+
{
1346+
if ((suffix[0] == lgMessagesRTCM[x].msgTextName[0]) &&
1347+
(strcmp(suffix, lgMessagesRTCM[x].msgTextName) == 0))
1348+
{
1349+
settings.lg290pMessageRatesRTCMRover[x] = d;
1350+
knownSetting = true;
1351+
break;
1352+
}
1353+
}
1354+
}
1355+
#endif
1356+
break;
1357+
1358+
#ifdef COMPILE_ZED
1359+
case tUbxConst: {
1360+
// Covered by ttCmnCnst
12301361
}
12311362
break;
12321363
case tUbxMsgRt: {
@@ -1361,55 +1492,19 @@ bool parseLine(char *str)
13611492

13621493
#ifdef COMPILE_UM980
13631494
case tUmMRNmea: {
1364-
for (int x = 0; x < qualifier; x++)
1365-
{
1366-
if ((suffix[0] == umMessagesNMEA[x].msgTextName[0]) &&
1367-
(strcmp(suffix, umMessagesNMEA[x].msgTextName) == 0))
1368-
{
1369-
settings.um980MessageRatesNMEA[x] = d;
1370-
knownSetting = true;
1371-
break;
1372-
}
1373-
}
1495+
// Covered by tCmnRtNm
13741496
}
13751497
break;
13761498
case tUmMRRvRT: {
1377-
for (int x = 0; x < qualifier; x++)
1378-
{
1379-
if ((suffix[0] == umMessagesRTCM[x].msgTextName[0]) &&
1380-
(strcmp(suffix, umMessagesRTCM[x].msgTextName) == 0))
1381-
{
1382-
settings.um980MessageRatesRTCMRover[x] = d;
1383-
knownSetting = true;
1384-
break;
1385-
}
1386-
}
1499+
// Covered by tCnRtRtR
13871500
}
13881501
break;
13891502
case tUmMRBaRT: {
1390-
for (int x = 0; x < qualifier; x++)
1391-
{
1392-
if ((suffix[0] == umMessagesRTCM[x].msgTextName[0]) &&
1393-
(strcmp(suffix, umMessagesRTCM[x].msgTextName) == 0))
1394-
{
1395-
settings.um980MessageRatesRTCMBase[x] = d;
1396-
knownSetting = true;
1397-
break;
1398-
}
1399-
}
1503+
// Covered by tCnRtRtB
14001504
}
14011505
break;
14021506
case tUmConst: {
1403-
for (int x = 0; x < qualifier; x++)
1404-
{
1405-
if ((suffix[0] == um980ConstellationCommands[x].textName[0]) &&
1406-
(strcmp(suffix, um980ConstellationCommands[x].textName) == 0))
1407-
{
1408-
settings.um980Constellations[x] = d;
1409-
knownSetting = true;
1410-
break;
1411-
}
1412-
}
1507+
// Covered by tCmnCnst
14131508
}
14141509
break;
14151510
#endif // COMPILE_UM980
@@ -1439,16 +1534,7 @@ bool parseLine(char *str)
14391534

14401535
#ifdef COMPILE_MOSAICX5
14411536
case tMosaicConst: {
1442-
for (int x = 0; x < qualifier; x++)
1443-
{
1444-
if ((suffix[0] == mosaicSignalConstellations[x].configName[0]) &&
1445-
(strcmp(suffix, mosaicSignalConstellations[x].configName) == 0))
1446-
{
1447-
settings.mosaicConstellations[x] = d;
1448-
knownSetting = true;
1449-
break;
1450-
}
1451-
}
1537+
// Covered by tCmnCnst
14521538
}
14531539
break;
14541540
case tMosaicMSNmea: {
@@ -1530,42 +1616,15 @@ bool parseLine(char *str)
15301616

15311617
#ifdef COMPILE_LG290P
15321618
case tLgMRNmea: {
1533-
for (int x = 0; x < qualifier; x++)
1534-
{
1535-
if ((suffix[0] == lgMessagesNMEA[x].msgTextName[0]) &&
1536-
(strcmp(suffix, lgMessagesNMEA[x].msgTextName) == 0))
1537-
{
1538-
settings.lg290pMessageRatesNMEA[x] = d;
1539-
knownSetting = true;
1540-
break;
1541-
}
1542-
}
1619+
// Covered by tCmnRtNm
15431620
}
15441621
break;
15451622
case tLgMRRvRT: {
1546-
for (int x = 0; x < qualifier; x++)
1547-
{
1548-
if ((suffix[0] == lgMessagesRTCM[x].msgTextName[0]) &&
1549-
(strcmp(suffix, lgMessagesRTCM[x].msgTextName) == 0))
1550-
{
1551-
settings.lg290pMessageRatesRTCMRover[x] = d;
1552-
knownSetting = true;
1553-
break;
1554-
}
1555-
}
1623+
// Covered by tCnRtRtR
15561624
}
15571625
break;
15581626
case tLgMRBaRT: {
1559-
for (int x = 0; x < qualifier; x++)
1560-
{
1561-
if ((suffix[0] == lgMessagesRTCM[x].msgTextName[0]) &&
1562-
(strcmp(suffix, lgMessagesRTCM[x].msgTextName) == 0))
1563-
{
1564-
settings.lg290pMessageRatesRTCMBase[x] = d;
1565-
knownSetting = true;
1566-
break;
1567-
}
1568-
}
1627+
// Covered by tCnRtRtB
15691628
}
15701629
break;
15711630
case tLgMRPqtm: {
@@ -1582,16 +1641,7 @@ bool parseLine(char *str)
15821641
}
15831642
break;
15841643
case tLgConst: {
1585-
for (int x = 0; x < qualifier; x++)
1586-
{
1587-
if ((suffix[0] == lg290pConstellationNames[x][0]) &&
1588-
(strcmp(suffix, lg290pConstellationNames[x]) == 0))
1589-
{
1590-
settings.lg290pConstellations[x] = d;
1591-
knownSetting = true;
1592-
break;
1593-
}
1594-
}
1644+
// Covered by tCmnCnst
15951645
}
15961646
break;
15971647
#endif // COMPILE_LG290P

0 commit comments

Comments
 (0)