Skip to content

Commit 8fb9e6c

Browse files
committed
Fix tCmnCnst case in getSettingValue
1 parent 1716093 commit 8fb9e6c

File tree

1 file changed

+59
-51
lines changed

1 file changed

+59
-51
lines changed

Firmware/RTK_Everywhere/menuCommands.ino

Lines changed: 59 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ t_cliResult processCommand(char *cmdBuffer)
4242
// These commands are not part of the CLI and allow quick testing without validity check
4343
if ((strcmp(cmdBuffer, "x") == 0) || (strcmp(cmdBuffer, "exit") == 0))
4444
{
45+
if (settings.debugCLI == true)
46+
systemPrintln("Exiting CLI...");
4547
return (CLI_EXIT); // Exit command mode
4648
}
4749
else if (strcmp(cmdBuffer, "list") == 0)
@@ -536,6 +538,9 @@ int commandLookupSettingName(bool inCommands, const char *settingName, char *tru
536538
}
537539

538540
// Command not found
541+
if (settings.debugCLI == true)
542+
systemPrintf("commandLookupSettingName: Command not found: %s\r\n", settingName);
543+
539544
return COMMAND_UNKNOWN;
540545
}
541546

@@ -852,7 +857,7 @@ SettingValueResponse updateSettingWithValue(bool inCommands, const char *setting
852857

853858
#ifdef COMPILE_ZED
854859
case tUbxConst: {
855-
// Covered by ttCmnCnst
860+
// Covered by tCmnCnst
856861
}
857862
break;
858863
case tUbxMsgRt: {
@@ -2368,6 +2373,7 @@ SettingValueResponse getSettingValue(bool inCommands, const char *settingName, c
23682373
qualifier = rtkSettingsEntries[i].qualifier;
23692374
type = rtkSettingsEntries[i].type;
23702375
var = rtkSettingsEntries[i].var;
2376+
23712377
switch (type)
23722378
{
23732379
default:
@@ -2483,18 +2489,23 @@ SettingValueResponse getSettingValue(bool inCommands, const char *settingName, c
24832489
}
24842490
break;
24852491

2486-
case tCmnCnst:
2487-
break; // Nothing to do here. Let each GNSS add its settings
2488-
case tCmnRtNm:
2489-
break; // Nothing to do here. Let each GNSS add its settings
2490-
case tCnRtRtB:
2491-
break; // Nothing to do here. Let each GNSS add its settings
2492-
case tCnRtRtR:
2493-
break; // Nothing to do here. Let each GNSS add its settings
2492+
case tCmnCnst: {
2493+
2494+
#ifdef COMPILE_MOSAICX5
2495+
for (int x = 0; x < MAX_MOSAIC_CONSTELLATIONS; x++)
2496+
{
2497+
if ((suffix[0] == mosaicSignalConstellations[x].configName[0]) &&
2498+
(strcmp(suffix, mosaicSignalConstellations[x].configName) == 0))
2499+
{
2500+
writeToString(settingValueStr, settings.mosaicConstellations[x]);
2501+
knownSetting = true;
2502+
break;
2503+
}
2504+
}
2505+
#endif // COMPILE_MOSAICX5
24942506

24952507
#ifdef COMPILE_ZED
2496-
case tUbxConst: {
2497-
for (int x = 0; x < qualifier; x++)
2508+
for (int x = 0; x < MAX_UBX_CONSTELLATIONS; x++)
24982509
{
24992510
if ((suffix[0] == settings.ubxConstellations[x].textName[0]) &&
25002511
(strcmp(suffix, settings.ubxConstellations[x].textName) == 0))
@@ -2504,8 +2515,42 @@ SettingValueResponse getSettingValue(bool inCommands, const char *settingName, c
25042515
break;
25052516
}
25062517
}
2518+
#endif // COMPILE_ZED
2519+
2520+
#ifdef COMPILE_UM980
2521+
for (int x = 0; x < MAX_UM980_CONSTELLATIONS; x++)
2522+
{
2523+
if ((suffix[0] == um980ConstellationCommands[x].textName[0]) &&
2524+
(strcmp(suffix, um980ConstellationCommands[x].textName) == 0))
2525+
{
2526+
writeToString(settingValueStr, settings.um980Constellations[x]);
2527+
knownSetting = true;
2528+
break;
2529+
}
2530+
}
2531+
#endif // COMPILE_UM980
2532+
2533+
#ifdef COMPILE_LG290P
2534+
for (int x = 0; x < qualifier; x++)
2535+
{
2536+
if ((suffix[0] == lg290pConstellationNames[x][0]) && (strcmp(suffix, lg290pConstellationNames[x]) == 0))
2537+
{
2538+
writeToString(settingValueStr, settings.lg290pConstellations[x]);
2539+
knownSetting = true;
2540+
break;
2541+
}
2542+
}
2543+
#endif // COMPILE_LG290P
25072544
}
2508-
break;
2545+
break; // Nothing to do here. Let each GNSS add its settings
2546+
case tCmnRtNm:
2547+
break; // Nothing to do here. Let each GNSS add its settings
2548+
case tCnRtRtB:
2549+
break; // Nothing to do here. Let each GNSS add its settings
2550+
case tCnRtRtR:
2551+
break; // Nothing to do here. Let each GNSS add its settings
2552+
2553+
#ifdef COMPILE_ZED
25092554
case tUbxMsgRt: {
25102555
for (int x = 0; x < qualifier; x++)
25112556
{
@@ -2674,19 +2719,6 @@ SettingValueResponse getSettingValue(bool inCommands, const char *settingName, c
26742719
}
26752720
}
26762721
break;
2677-
case tUmConst: {
2678-
for (int x = 0; x < qualifier; x++)
2679-
{
2680-
if ((suffix[0] == um980ConstellationCommands[x].textName[0]) &&
2681-
(strcmp(suffix, um980ConstellationCommands[x].textName) == 0))
2682-
{
2683-
writeToString(settingValueStr, settings.um980Constellations[x]);
2684-
knownSetting = true;
2685-
break;
2686-
}
2687-
}
2688-
}
2689-
break;
26902722
#endif // COMPILE_UM980
26912723

26922724
case tCorrSPri: {
@@ -2713,19 +2745,6 @@ SettingValueResponse getSettingValue(bool inCommands, const char *settingName, c
27132745
break;
27142746

27152747
#ifdef COMPILE_MOSAICX5
2716-
case tMosaicConst: {
2717-
for (int x = 0; x < qualifier; x++)
2718-
{
2719-
if ((suffix[0] == mosaicSignalConstellations[x].configName[0]) &&
2720-
(strcmp(suffix, mosaicSignalConstellations[x].configName) == 0))
2721-
{
2722-
writeToString(settingValueStr, settings.mosaicConstellations[x]);
2723-
knownSetting = true;
2724-
break;
2725-
}
2726-
}
2727-
}
2728-
break;
27292748
case tMosaicMSNmea: {
27302749
for (int x = 0; x < qualifier; x++)
27312750
{
@@ -2856,18 +2875,7 @@ SettingValueResponse getSettingValue(bool inCommands, const char *settingName, c
28562875
}
28572876
}
28582877
break;
2859-
case tLgConst: {
2860-
for (int x = 0; x < qualifier; x++)
2861-
{
2862-
if ((suffix[0] == lg290pConstellationNames[x][0]) && (strcmp(suffix, lg290pConstellationNames[x]) == 0))
2863-
{
2864-
writeToString(settingValueStr, settings.lg290pConstellations[x]);
2865-
knownSetting = true;
2866-
break;
2867-
}
2868-
}
2869-
}
2870-
break;
2878+
28712879
#endif // COMPILE_LG290P
28722880

28732881
case tGnssReceiver: {
@@ -2958,7 +2966,7 @@ SettingValueResponse getSettingValue(bool inCommands, const char *settingName, c
29582966

29592967
if (knownSetting == false)
29602968
{
2961-
if (settings.debugWebServer)
2969+
if (settings.debugWebServer || settings.debugCLI)
29622970
systemPrintf("getSettingValue() Unknown setting: %s\r\n", settingName);
29632971
}
29642972

0 commit comments

Comments
 (0)