bool WesterboerDevice::ParseNMEA(const char *String, NMEAInfo &info) { if (!VerifyNMEAChecksum(String)) return false; NMEAInputLine line(String); char type[16]; line.read(type, 16); if (StringIsEqual(type, "$PWES0")) return PWES0(line, info); if (StringIsEqual(type, "$PWES1")) return PWES1(line, info); return false; }
static BOOL WesterboerParseNMEA(PDeviceDescriptor_t d, TCHAR *String, NMEA_INFO *pGPS){ (void)d; if (!NMEAParser::NMEAChecksum(String) || (pGPS == NULL)){ return FALSE; } /* this is for auto MC calculation, because we do not get a notification on changed * MC while changed by auto calac */ if(_tcsncmp(TEXT("$PWES0"), String, 6)==0) { if(iWEST_RxUpdateTime > 0) { iWEST_RxUpdateTime--; } else { static double oldMC =0; if(fabs(oldMC - MACCREADY)> 0.01f) { oldMC = MACCREADY; devWesterboerPutMacCready( d, MACCREADY); } static double fOldWingLoad= -1.0; if( fabs(fOldWingLoad - GlidePolar::WingLoading)> 0.05f) { fOldWingLoad = GlidePolar::WingLoading; devWesterboerPutWingload( d, GlidePolar::WingLoading ); } } } if(_tcsncmp(TEXT("$PWES0"), String, 6)==0) { RequestInfos(d); return PWES0(d, &String[7], pGPS); } else if(_tcsncmp(TEXT("$PWES1"), String, 6)==0) { if( iReceiveSuppress > 0) { iReceiveSuppress--; return false; } return PWES1(d, &String[7], pGPS); } else if(_tcsncmp(TEXT("$PWES2"), String, 6)==0) { return PWES2(d, &String[7], pGPS); } return FALSE; }