bool ubloxNMEA::parseFix( char chr ) { if (chrCount == 0) { NMEAGPS_INVALIDATE( status ); if (chr == 'N') m_fix.status = gps_fix::STATUS_NONE; else if (chr == 'T') m_fix.status = gps_fix::STATUS_TIME_ONLY; else if (chr == 'R') m_fix.status = gps_fix::STATUS_EST; else if (chr == 'G') m_fix.status = gps_fix::STATUS_STD; else if (chr == 'D') m_fix.status = gps_fix::STATUS_DGPS; } else if (chrCount == 1) { if (((chr == 'T') && (m_fix.status == gps_fix::STATUS_TIME_ONLY)) || ((chr == 'K') && (m_fix.status == gps_fix::STATUS_EST)) || (((chr == '2') || (chr == '3')) && ((m_fix.status == gps_fix::STATUS_STD) || (m_fix.status == gps_fix::STATUS_DGPS))) || ((chr == 'F') && (m_fix.status == gps_fix::STATUS_NONE))) // status based on first char was ok guess m_fix.valid.status = true; else if ((chr == 'R') && (m_fix.status == gps_fix::STATUS_DGPS)) { m_fix.status = gps_fix::STATUS_EST; // oops, was DR instead m_fix.valid.status = true; } } return true; }
bool ubloxNMEA::parseVelocityDown( char chr ) { #ifdef GPS_FIX_VELNED if (chrCount == 0) NMEAGPS_INVALIDATE( velned ); // Checks for alias size. char test[ (int)sizeof(m_fix.velocity_down) - (int)sizeof(gps_fix::whole_frac) ]; gps_fix::whole_frac *temp = (gps_fix::whole_frac *) &m_fix.velocity_down; // an alias for parsing if (parseFloat( *temp, chr, 3 )) { // 0.001 m/s if (chr == ',') { // convert the temporary whole_frac values in place m_fix.valid.velned = (chrCount > 0); if (m_fix.valid.velned) { m_fix.velocity_down = (temp->int32_000() + 5) / 10L; // mm/s to cm/s } } } #endif return true; } // parseVelocityDown