@@ -1574,6 +1574,7 @@ void GNSS_LG290P::menuMessages()
1574
1574
systemPrintln (" 1) Set NMEA Messages" );
1575
1575
systemPrintln (" 2) Set Rover RTCM Messages" );
1576
1576
systemPrintln (" 3) Set Base RTCM Messages" );
1577
+ systemPrintln (" 4) Set PQTM Messages" );
1577
1578
1578
1579
systemPrintln (" 10) Reset to Defaults" );
1579
1580
@@ -1587,6 +1588,8 @@ void GNSS_LG290P::menuMessages()
1587
1588
menuMessagesSubtype (settings.lg290pMessageRatesRTCMRover , " RTCMRover" );
1588
1589
else if (incoming == 3 )
1589
1590
menuMessagesSubtype (settings.lg290pMessageRatesRTCMBase , " RTCMBase" );
1591
+ else if (incoming == 4 )
1592
+ menuMessagesSubtype (settings.lg290pMessageRatesPQTM , " PQTM" );
1590
1593
else if (incoming == 10 )
1591
1594
{
1592
1595
// Reset rates to defaults
@@ -1601,6 +1604,10 @@ void GNSS_LG290P::menuMessages()
1601
1604
for (int x = 0 ; x < MAX_LG290P_RTCM_MSG; x++)
1602
1605
settings.lg290pMessageRatesRTCMBase [x] = lgMessagesRTCM[x].msgDefaultRate ;
1603
1606
1607
+ // Reset PQTM rates to defaults
1608
+ for (int x = 0 ; x < MAX_LG290P_PQTM_MSG; x++)
1609
+ settings.lg290pMessageRatesPQTM [x] = lgMessagesPQTM[x].msgDefaultRate ;
1610
+
1604
1611
systemPrintln (" Reset to Defaults" );
1605
1612
}
1606
1613
@@ -1638,7 +1645,7 @@ void GNSS_LG290P::menuMessagesSubtype(int *localMessageRate, const char *message
1638
1645
{
1639
1646
endOfBlock = MAX_LG290P_NMEA_MSG;
1640
1647
1641
- for (int x = 0 ; x < MAX_LG290P_NMEA_MSG ; x++)
1648
+ for (int x = 0 ; x < endOfBlock ; x++)
1642
1649
{
1643
1650
if (lg290pFirmwareVersion <= lgMessagesNMEA[x].firmwareVersionSupported )
1644
1651
systemPrintf (" %d) Message %s: %d - Requires firmware update\r\n " , x + 1 ,
@@ -1652,7 +1659,7 @@ void GNSS_LG290P::menuMessagesSubtype(int *localMessageRate, const char *message
1652
1659
{
1653
1660
endOfBlock = MAX_LG290P_RTCM_MSG;
1654
1661
1655
- for (int x = 0 ; x < MAX_LG290P_RTCM_MSG ; x++)
1662
+ for (int x = 0 ; x < endOfBlock ; x++)
1656
1663
{
1657
1664
if (lg290pFirmwareVersion <= lgMessagesRTCM[x].firmwareVersionSupported )
1658
1665
systemPrintf (" %d) Message %s: %d - Requires firmware update\r\n " , x + 1 ,
@@ -1666,16 +1673,30 @@ void GNSS_LG290P::menuMessagesSubtype(int *localMessageRate, const char *message
1666
1673
{
1667
1674
endOfBlock = MAX_LG290P_RTCM_MSG;
1668
1675
1669
- for (int x = 0 ; x < MAX_LG290P_RTCM_MSG ; x++)
1676
+ for (int x = 0 ; x < endOfBlock ; x++)
1670
1677
{
1671
1678
if (lg290pFirmwareVersion <= lgMessagesRTCM[x].firmwareVersionSupported )
1672
- systemPrintf (" %d) Message %s: %d - Requires firmware update\r\n " , x + 1 , lgMessagesRTCM[x]. msgTextName ,
1673
- settings.lg290pMessageRatesRTCMBase [x]);
1679
+ systemPrintf (" %d) Message %s: %d - Requires firmware update\r\n " , x + 1 ,
1680
+ lgMessagesRTCM[x]. msgTextName , settings.lg290pMessageRatesRTCMBase [x]);
1674
1681
else
1675
1682
systemPrintf (" %d) Message %s: %d\r\n " , x + 1 , lgMessagesRTCM[x].msgTextName ,
1676
1683
settings.lg290pMessageRatesRTCMBase [x]);
1677
1684
}
1678
1685
}
1686
+ else if (strcmp (messageType, " PQTM" ) == 0 )
1687
+ {
1688
+ endOfBlock = MAX_LG290P_PQTM_MSG;
1689
+
1690
+ for (int x = 0 ; x < endOfBlock; x++)
1691
+ {
1692
+ if (lg290pFirmwareVersion <= lgMessagesPQTM[x].firmwareVersionSupported )
1693
+ systemPrintf (" %d) Message %s: %d - Requires firmware update\r\n " , x + 1 ,
1694
+ lgMessagesPQTM[x].msgTextName , settings.lg290pMessageRatesPQTM [x]);
1695
+ else
1696
+ systemPrintf (" %d) Message %s: %d\r\n " , x + 1 , lgMessagesPQTM[x].msgTextName ,
1697
+ settings.lg290pMessageRatesPQTM [x]);
1698
+ }
1699
+ }
1679
1700
1680
1701
systemPrintln (" x) Exit" );
1681
1702
@@ -1698,6 +1719,11 @@ void GNSS_LG290P::menuMessagesSubtype(int *localMessageRate, const char *message
1698
1719
sprintf (messageString, " Enter number of fixes required before %s is reported (0 to disable)" ,
1699
1720
lgMessagesRTCM[incoming].msgTextName );
1700
1721
}
1722
+ else if (strcmp (messageType, " PQTM" ) == 0 )
1723
+ {
1724
+ sprintf (messageString, " Enter number of fixes required before %s is reported (0 to disable)" ,
1725
+ lgMessagesPQTM[incoming].msgTextName );
1726
+ }
1701
1727
1702
1728
int newSetting = 0 ;
1703
1729
@@ -1718,6 +1744,11 @@ void GNSS_LG290P::menuMessagesSubtype(int *localMessageRate, const char *message
1718
1744
if (getNewSetting (messageString, 0 , 1200 , &newSetting) == INPUT_RESPONSE_VALID)
1719
1745
settings.lg290pMessageRatesRTCMBase [incoming] = newSetting;
1720
1746
}
1747
+ if (strcmp (messageType, " PQTM" ) == 0 )
1748
+ {
1749
+ if (getNewSetting (messageString, 0 , 1 , &newSetting) == INPUT_RESPONSE_VALID)
1750
+ settings.lg290pMessageRatesPQTM [incoming] = newSetting;
1751
+ }
1721
1752
}
1722
1753
else if (incoming == INPUT_RESPONSE_GETNUMBER_EXIT)
1723
1754
break ;
@@ -2134,3 +2165,56 @@ void lg290pReset()
2134
2165
{
2135
2166
digitalWrite (pin_GNSS_Reset, LOW);
2136
2167
}
2168
+
2169
+ // Given a NMEA or PQTM sentence, determine if it is enabled in settings
2170
+ // This is used to signal to the processUart1Message() task to remove messages that are needed
2171
+ // by the library to function (ie, PQTMEPE, PQTMPVT, GNGSV) but should not be logged or passed to other consumers
2172
+ // If unknown, allow messages through. Filtering and suppression should be selectively added in.
2173
+ bool lg290pMessageEnabled (char *nmeaSentence, int sentenceLength)
2174
+ {
2175
+ // Identify message type: PQTM or NMEA
2176
+ char messageType[strlen (" PQTM" ) + 1 ] = {0 };
2177
+ strncpy (messageType, &nmeaSentence[1 ],
2178
+ 4 ); // Copy four letters, starting in spot 1. Null terminated from array initializer.
2179
+
2180
+ if (strncmp (messageType, " PQTM" , sizeof (messageType)) == 0 )
2181
+ {
2182
+ // Identify sentence type
2183
+ char sentenceType[strlen (" EPE" ) + 1 ] = {0 };
2184
+ strncpy (sentenceType, &nmeaSentence[5 ],
2185
+ 3 ); // Copy three letters, starting in spot 5. Null terminated from array initializer.
2186
+
2187
+ // Find this sentence type in the settings array
2188
+ for (int messageNumber = 0 ; messageNumber < MAX_LG290P_PQTM_MSG; messageNumber++)
2189
+ {
2190
+ if (strncmp (lgMessagesPQTM[messageNumber].msgTextName , sentenceType, sizeof (sentenceType)) == 0 )
2191
+ {
2192
+ if (settings.lg290pMessageRatesPQTM [messageNumber] > 0 )
2193
+ return (true );
2194
+ return (false );
2195
+ }
2196
+ }
2197
+ }
2198
+
2199
+ else // We have to assume $G????
2200
+ {
2201
+ // Identify sentence type
2202
+ char sentenceType[strlen (" GSV" ) + 1 ] = {0 };
2203
+ strncpy (sentenceType, &nmeaSentence[3 ],
2204
+ 3 ); // Copy three letters, starting in spot 3. Null terminated from array initializer.
2205
+
2206
+ // Find this sentence type in the settings array
2207
+ for (int messageNumber = 0 ; messageNumber < MAX_LG290P_NMEA_MSG; messageNumber++)
2208
+ {
2209
+ if (strncmp (lgMessagesNMEA[messageNumber].msgTextName , sentenceType, sizeof (sentenceType)) == 0 )
2210
+ {
2211
+ if (settings.lg290pMessageRatesNMEA [messageNumber] > 0 )
2212
+ return (true );
2213
+ return (false );
2214
+ }
2215
+ }
2216
+ }
2217
+
2218
+ // If we can't ID this message, allow it by default. The device configuration should control most message flow.
2219
+ return (true );
2220
+ }
0 commit comments