Plus sign in NMEA sentences not supported.
I am using a modem Cypress CTM-200 and processing the GPS coordinates with Nematode.
I am getting the following sentences from the modem. Unfortunately a plus sign is included before the altitude field in the GPGGA sentence. Plus sign is not supported and the sentence cannot be processed.
$PMID,353968095226388,35396809522638810 $GPGGA,194045.00,4531.6094,N,07331.1947,W,1,11,01.1,+00053,M,,M,,00006B $GPRMC,194045.00,A,4531.6094,N,07331.1947,W,000.2,000.0,160519,,*21
I'll patch this weekend. Thanks for reporting.
The problem sentence should be:
$GPGGA,194045.00,4531.6094,N,07331.1947,W,1,11,01.1,+00053,M,,M,,0000*6B
The fix is fairly straight forward in NMEAParser.cpp:
// true if alphanumeric or '-' or '+'
bool validParamChars(string txt)
{
for (size_t i = 0; i < txt.size(); i++)
{
if (!isalnum(txt[i]))
{
if (txt[i] != '-' && txt[i] != '.' && txt[i] != '+')
{
return false;
}
}
}
return true;
}