-
Notifications
You must be signed in to change notification settings - Fork 8
sentence without * and CRC #8
Description
Hello,
thank you very much for your wonderful NMEAparser, which is very conveniant to implement. I've got a sentence from my stratux box (collision avoiding for gliders), which sends the usual nmea sentences like GPRMC .... with *CRC, but also a sentences without a CRC and NO * e.g. ($RPYL)
$GPGGA,xxxxxx,M,,*68 <- valid nmea sentence with *CRC
$RPYL,15,9,314,11,0,1009,0 <- no CRC!!!
$GPGSA,A,xxx,1.03,1.380A <- valid nmea sentence with *CRC
your code doesn't recognize this, just reads the next sentence GPGSA and issue a lot of unrecognized char error with an buffer full error.
pls. add my suggested code (marked with +- 2025012) to your code:
case ARG:
if (spaceAvail()) {
switch(inChar) {
case ',' :
mComputedCRC ^= inChar;
mBuffer[--mArgIndex] = mIndex;
break;
case '*' :
mGotCRC = 0;
mBuffer[--mArgIndex] = mIndex;
mState = CRCH;
break;
case '\r' : // + SF 20250112
mGotCRC = 0;
mComputedCRC = 0;
mBuffer[--mArgIndex] = mIndex;
mState = CRLFLF;
break; // - SF 20250112
default :
mComputedCRC ^= inChar;
mBuffer[mIndex++] = inChar;
break;
}
}
else bufferFull();
break;
I've tried to find a description in the official NMEA spec, how to handle non CRC sentences.
I couldn't find a definition, if the * has to be last character if the crc is omitted, or the * can be omitted also.