Skip to content

Commit 9ff519f

Browse files
committed
Add um980GetNmeaMessageNumberByName
1 parent 321837b commit 9ff519f

File tree

1 file changed

+27
-14
lines changed

1 file changed

+27
-14
lines changed

Firmware/RTK_Everywhere/UM980.ino

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ void um980Begin()
4242
//If NMEA GPGGA is turned off, enable BESTNAV messages at power on which may lead to longer UM980 configuration times
4343
um980->enableBinaryBeforeFix();
4444

45-
4645
if (um980->begin(*serialGNSS) == false) // Give the serial port over to the library
4746
{
4847
if (settings.debugGnss)
@@ -894,10 +893,11 @@ uint8_t um980GetActiveNmeaMessageCount()
894893
// Return true if the GPGGA message is active
895894
bool um980IsGgaActive()
896895
{
897-
// 2 = GPGGA. We could do this with a walking text search but this is sufficient.
898-
if(settings.um980MessageRatesNMEA[2] > 0)
899-
return (true);
900-
return (false);
896+
Serial.printf("Nmea test: %d\r\n", um980GetNmeaMessageNumberByName("GPGGA"));
897+
898+
if (settings.um980MessageRatesNMEA[um980GetNmeaMessageNumberByName("GPGGA")] > 0)
899+
return (true);
900+
return (false);
901901
}
902902

903903
uint8_t um980GetActiveRtcmMessageCount()
@@ -1125,25 +1125,38 @@ void um980BaseRtcmLowDataRate()
11251125
for (int x = 0; x < MAX_UM980_RTCM_MSG; x++)
11261126
settings.um980MessageRatesRTCMBase[x] = 0;
11271127

1128-
settings.um980MessageRatesRTCMBase[um980GetMessageNumberByName("RTCM1005")] =
1128+
settings.um980MessageRatesRTCMBase[um980GetRtcmMessageNumberByName("RTCM1005")] =
11291129
10; // 1005 0.1Hz - Exclude antenna height
1130-
settings.um980MessageRatesRTCMBase[um980GetMessageNumberByName("RTCM1074")] = 2; // 1074 0.5Hz
1131-
settings.um980MessageRatesRTCMBase[um980GetMessageNumberByName("RTCM1084")] = 2; // 1084 0.5Hz
1132-
settings.um980MessageRatesRTCMBase[um980GetMessageNumberByName("RTCM1094")] = 2; // 1094 0.5Hz
1133-
settings.um980MessageRatesRTCMBase[um980GetMessageNumberByName("RTCM1124")] = 2; // 1124 0.5Hz
1134-
settings.um980MessageRatesRTCMBase[um980GetMessageNumberByName("RTCM1033")] = 10; // 1033 0.1Hz
1130+
settings.um980MessageRatesRTCMBase[um980GetRtcmMessageNumberByName("RTCM1074")] = 2; // 1074 0.5Hz
1131+
settings.um980MessageRatesRTCMBase[um980GetRtcmMessageNumberByName("RTCM1084")] = 2; // 1084 0.5Hz
1132+
settings.um980MessageRatesRTCMBase[um980GetRtcmMessageNumberByName("RTCM1094")] = 2; // 1094 0.5Hz
1133+
settings.um980MessageRatesRTCMBase[um980GetRtcmMessageNumberByName("RTCM1124")] = 2; // 1124 0.5Hz
1134+
settings.um980MessageRatesRTCMBase[um980GetRtcmMessageNumberByName("RTCM1033")] = 10; // 1033 0.1Hz
11351135
}
11361136

1137-
// Given the name of a message, return the array number
1138-
uint8_t um980GetMessageNumberByName(const char *msgName)
1137+
// Given the name of an RTCM message, return the array number
1138+
uint8_t um980GetRtcmMessageNumberByName(const char *msgName)
11391139
{
11401140
for (int x = 0; x < MAX_UM980_RTCM_MSG; x++)
11411141
{
11421142
if (strcmp(umMessagesRTCM[x].msgTextName, msgName) == 0)
11431143
return (x);
11441144
}
11451145

1146-
systemPrintf("um980GetMessageNumberByName: %s not found\r\n", msgName);
1146+
systemPrintf("um980GetRtcmMessageNumberByName: %s not found\r\n", msgName);
1147+
return (0);
1148+
}
1149+
1150+
// Given the name of an NMEA message, return the array number
1151+
uint8_t um980GetNmeaMessageNumberByName(const char *msgName)
1152+
{
1153+
for (int x = 0; x < MAX_UM980_NMEA_MSG; x++)
1154+
{
1155+
if (strcmp(umMessagesNMEA[x].msgTextName, msgName) == 0)
1156+
return (x);
1157+
}
1158+
1159+
systemPrintf("um980GetNmeaMessageNumberByName: %s not found\r\n", msgName);
11471160
return (0);
11481161
}
11491162

0 commit comments

Comments
 (0)