void parseString(){ if (strncmp(parseptr, "$GPGGA",6) == 0) parseGPGGA(); if (strncmp(parseptr, "$GPGSA",6) == 0) parseGPGSA(); if (strncmp(parseptr, "$GPRMC",6) == 0 ) parseGPRMC(); if (strncmp(parseptr, "$GPVTG",6) == 0 ) parseGPVTG(); if (strncmp(parseptr, "$HCHDG",6) == 0) parseHCHDG(); if (strncmp(parseptr, "$WIMDA",6) == 0 ) parseWIMDA(); if (strncmp(parseptr, "$PFEC,GPatt",11) == 0 ) parsePFEC(); if (strncmp(parseptr, "$WIXDR",6) == 0 ) parseWIXDR(); if (strncmp(parseptr, "$RDATA",6) == 0 ) parseRDATA(); } void parseGPGGA(){ parseptr = parseptr+7; float inFloat; for (int i = 1; i<10;i++){ if (parseptr[0] != ',') { switch (i){ case 1: inFloat= atof(parseptr); timeHHMMSS = (uint32_t)inFloat; break; case 2: lattitude = atof(parseptr); break; case 4: longitude = atof(parseptr); case 6: fixQuality = atoi(parseptr); if(fixQuality == 0) gpsFix = false; else gpsFix = true; case 9: alt = atof(parseptr); default: break; } parseptr = strchr(parseptr, ',') + 1; } else parseptr = parseptr +1; } } void parseGPGSA(){ parseptr = parseptr+7; if (parseptr[9] == 3) gpsFix = true; else gpsFix = false; } void parseGPRMC(){ parseptr = parseptr+7; float inFloat; for (int i = 1; i<9;i++){ if (parseptr[0] != ',') { switch (i){ case 1: inFloat= atof(parseptr); timeHHMMSS = (uint32_t)inFloat; break; case 3: lattitude = atof(parseptr); break; case 5: longitude = atof(parseptr); break; case 7: speedKnots = atof(parseptr); break; case 8: trueHeading = atof(parseptr); break; default: break; } parseptr = strchr(parseptr, ',') + 1; } else parseptr = parseptr +1; } } void parseGPVTG(){ parseptr = parseptr+7; for (int i = 1; i<8;i++){ if (parseptr[0] != ',') { switch (i){ case 1: trueHeading = atof(parseptr); break; case 3: magneticHeading = atof(parseptr); break; case 5: speedKnots = atof(parseptr); break; case 7: speedKMH = atof(parseptr); break; default: break; } parseptr = strchr(parseptr, ',') + 1; } else parseptr = parseptr +1; } } void parseHCHDG(){ parseptr = parseptr+7; for (int i = 1; i<8;i++){ if (parseptr[0] != ',') { switch (i){ case 1: trueHeading = atof(parseptr); break; case 3: magneticHeading = atof(parseptr); break; case 5: speedKnots = atof(parseptr); break; case 7: speedKMH = atof(parseptr); break; default: break; } parseptr = strchr(parseptr, ',') + 1; } else { parseptr = parseptr +1; } } } void parsePFEC(){ parseptr = parseptr+12; for (int i = 1; i<4;i++){ if (parseptr[0] != ',') { switch (i){ case 1: weatherPitch = atof(parseptr); break; case 2: weatherRoll = atof(parseptr); break; case 3: weatherYaw = atof(parseptr); break; default: break; } parseptr = strchr(parseptr, ',') + 1; } else parseptr = parseptr +1; } } void parseWIMDA(){ parseptr = parseptr+7; for (int i = 1; i<20;i++){ if (parseptr[0] != ',') { switch (i){ case 1: barometricPressureInches = atof(parseptr); break; case 3: barometricPressureBars= atof(parseptr); break; case 5: airTemp = atof(parseptr); break; case 9: relativeHumidity = atof(parseptr); break; case 11: dewPoint = atof(parseptr); break; case 13: windDirectionTrue = atof(parseptr); break; case 15: windDirectionMagnetic = atof(parseptr); break; case 17: windSpeedKnots = atof(parseptr); break; case 19: windSpeedMetersPerSecond = atof(parseptr); break; default: break; } parseptr = strchr(parseptr, ',') + 1; } else parseptr = parseptr +1; } } void parseWIXDR(){ parseptr = parseptr+7; for (int i = 1; i<15;i++){ if (parseptr[0] != ',') { switch (i){ case 2: relativeWindChill = atof(parseptr); break; case 6: theoreticalWindChill = atof(parseptr); break; case 10: weatherPitch = atof(parseptr); break; case 14: weatherRoll = atof(parseptr); break; default: break; } parseptr = strchr(parseptr, ',') + 1; } else parseptr = parseptr +1; } } void parseRDATA(){ parseptr = parseptr+7; for (int i = 1; i<4;i++){ if (parseptr[0] != ',') { switch (i){ case 1: countPerMinute = atoi(parseptr); break; case 3: microSievertPerHour = atof(parseptr); break; default: break; } parseptr = strchr(parseptr, ',') + 1; } else { parseptr = parseptr +1; } } }
Standard input is empty
prog.cpp: In function ‘void parseString()’: prog.cpp:2: error: ‘parseptr’ was not declared in this scope prog.cpp:2: error: ‘strncmp’ was not declared in this scope prog.cpp:3: error: ‘parseGPGGA’ was not declared in this scope prog.cpp:4: error: ‘parseptr’ was not declared in this scope prog.cpp:4: error: ‘strncmp’ was not declared in this scope prog.cpp:5: error: ‘parseGPGSA’ was not declared in this scope prog.cpp:6: error: ‘parseptr’ was not declared in this scope prog.cpp:6: error: ‘strncmp’ was not declared in this scope prog.cpp:7: error: ‘parseGPRMC’ was not declared in this scope prog.cpp:8: error: ‘parseptr’ was not declared in this scope prog.cpp:8: error: ‘strncmp’ was not declared in this scope prog.cpp:9: error: ‘parseGPVTG’ was not declared in this scope prog.cpp:10: error: ‘parseptr’ was not declared in this scope prog.cpp:10: error: ‘strncmp’ was not declared in this scope prog.cpp:11: error: ‘parseHCHDG’ was not declared in this scope prog.cpp:12: error: ‘parseptr’ was not declared in this scope prog.cpp:12: error: ‘strncmp’ was not declared in this scope prog.cpp:13: error: ‘parseWIMDA’ was not declared in this scope prog.cpp:14: error: ‘parseptr’ was not declared in this scope prog.cpp:14: error: ‘strncmp’ was not declared in this scope prog.cpp:15: error: ‘parsePFEC’ was not declared in this scope prog.cpp:16: error: ‘parseptr’ was not declared in this scope prog.cpp:16: error: ‘strncmp’ was not declared in this scope prog.cpp:17: error: ‘parseWIXDR’ was not declared in this scope prog.cpp:18: error: ‘parseptr’ was not declared in this scope prog.cpp:18: error: ‘strncmp’ was not declared in this scope prog.cpp:19: error: ‘parseRDATA’ was not declared in this scope prog.cpp: In function ‘void parseGPGGA()’: prog.cpp:23: error: ‘parseptr’ was not declared in this scope prog.cpp:29: error: ‘atof’ was not declared in this scope prog.cpp:30: error: ‘timeHHMMSS’ was not declared in this scope prog.cpp:30: error: ‘uint32_t’ was not declared in this scope prog.cpp:30: error: expected `;' before ‘inFloat’ prog.cpp:33: error: ‘lattitude’ was not declared in this scope prog.cpp:36: error: ‘longitude’ was not declared in this scope prog.cpp:38: error: ‘fixQuality’ was not declared in this scope prog.cpp:38: error: ‘atoi’ was not declared in this scope prog.cpp:40: error: ‘gpsFix’ was not declared in this scope prog.cpp:42: error: ‘gpsFix’ was not declared in this scope prog.cpp:44: error: ‘alt’ was not declared in this scope prog.cpp:48: error: ‘strchr’ was not declared in this scope prog.cpp: In function ‘void parseGPGSA()’: prog.cpp:55: error: ‘parseptr’ was not declared in this scope prog.cpp:57: error: ‘gpsFix’ was not declared in this scope prog.cpp:59: error: ‘gpsFix’ was not declared in this scope prog.cpp: In function ‘void parseGPRMC()’: prog.cpp:62: error: ‘parseptr’ was not declared in this scope prog.cpp:68: error: ‘atof’ was not declared in this scope prog.cpp:69: error: ‘timeHHMMSS’ was not declared in this scope prog.cpp:69: error: ‘uint32_t’ was not declared in this scope prog.cpp:69: error: expected `;' before ‘inFloat’ prog.cpp:72: error: ‘lattitude’ was not declared in this scope prog.cpp:75: error: ‘longitude’ was not declared in this scope prog.cpp:78: error: ‘speedKnots’ was not declared in this scope prog.cpp:81: error: ‘trueHeading’ was not declared in this scope prog.cpp:86: error: ‘strchr’ was not declared in this scope prog.cpp: In function ‘void parseGPVTG()’: prog.cpp:94: error: ‘parseptr’ was not declared in this scope prog.cpp:99: error: ‘trueHeading’ was not declared in this scope prog.cpp:99: error: ‘atof’ was not declared in this scope prog.cpp:102: error: ‘magneticHeading’ was not declared in this scope prog.cpp:105: error: ‘speedKnots’ was not declared in this scope prog.cpp:108: error: ‘speedKMH’ was not declared in this scope prog.cpp:113: error: ‘strchr’ was not declared in this scope prog.cpp: In function ‘void parseHCHDG()’: prog.cpp:123: error: ‘parseptr’ was not declared in this scope prog.cpp:128: error: ‘trueHeading’ was not declared in this scope prog.cpp:128: error: ‘atof’ was not declared in this scope prog.cpp:131: error: ‘magneticHeading’ was not declared in this scope prog.cpp:134: error: ‘speedKnots’ was not declared in this scope prog.cpp:137: error: ‘speedKMH’ was not declared in this scope prog.cpp:142: error: ‘strchr’ was not declared in this scope prog.cpp: In function ‘void parsePFEC()’: prog.cpp:151: error: ‘parseptr’ was not declared in this scope prog.cpp:156: error: ‘weatherPitch’ was not declared in this scope prog.cpp:156: error: ‘atof’ was not declared in this scope prog.cpp:159: error: ‘weatherRoll’ was not declared in this scope prog.cpp:162: error: ‘weatherYaw’ was not declared in this scope prog.cpp:167: error: ‘strchr’ was not declared in this scope prog.cpp: In function ‘void parseWIMDA()’: prog.cpp:174: error: ‘parseptr’ was not declared in this scope prog.cpp:179: error: ‘barometricPressureInches’ was not declared in this scope prog.cpp:179: error: ‘atof’ was not declared in this scope prog.cpp:182: error: ‘barometricPressureBars’ was not declared in this scope prog.cpp:185: error: ‘airTemp’ was not declared in this scope prog.cpp:188: error: ‘relativeHumidity’ was not declared in this scope prog.cpp:191: error: ‘dewPoint’ was not declared in this scope prog.cpp:194: error: ‘windDirectionTrue’ was not declared in this scope prog.cpp:197: error: ‘windDirectionMagnetic’ was not declared in this scope prog.cpp:200: error: ‘windSpeedKnots’ was not declared in this scope prog.cpp:203: error: ‘windSpeedMetersPerSecond’ was not declared in this scope prog.cpp:208: error: ‘strchr’ was not declared in this scope prog.cpp: In function ‘void parseWIXDR()’: prog.cpp:215: error: ‘parseptr’ was not declared in this scope prog.cpp:220: error: ‘relativeWindChill’ was not declared in this scope prog.cpp:220: error: ‘atof’ was not declared in this scope prog.cpp:223: error: ‘theoreticalWindChill’ was not declared in this scope prog.cpp:226: error: ‘weatherPitch’ was not declared in this scope prog.cpp:229: error: ‘weatherRoll’ was not declared in this scope prog.cpp:234: error: ‘strchr’ was not declared in this scope prog.cpp: In function ‘void parseRDATA()’: prog.cpp:242: error: ‘parseptr’ was not declared in this scope prog.cpp:247: error: ‘countPerMinute’ was not declared in this scope prog.cpp:247: error: ‘atoi’ was not declared in this scope prog.cpp:250: error: ‘microSievertPerHour’ was not declared in this scope prog.cpp:250: error: ‘atof’ was not declared in this scope prog.cpp:255: error: ‘strchr’ was not declared in this scope
Standard output is empty