NMEAParser icon indicating copy to clipboard operation
NMEAParser copied to clipboard

Incorrect conversion of RMC Speed in Knots

Open sfbence opened this issue 2 years ago • 0 comments

In the NMEASentenceRMC.cpp :

// Speed over ground knots
	if (GetField(pData, szField, 6, c_nMaxField) == CNMEAParserData::ERROR_OK) {
		m_SentenceData.m_dSpeedKnots = atol(szField);
	}

the use of atol() is incorrect, it converts to long int, should be a floating point conversion with atof(), like this: m_SentenceData.m_dSpeedKnots = atof(szField);

sfbence avatar May 10 '23 20:05 sfbence