example: indicate when a sentence is not parsed or is not valid

Indicate when a sentence is not parsed or is not valid. Before this
change, it was not clear from the example run whether each sentence is
parsed properly or not.
This commit is contained in:
Evgueni Souleimanov 2014-06-17 20:56:29 -04:00
parent 6f9ffab883
commit eede684d27

View File

@ -34,6 +34,9 @@ int main(void)
minmea_tocoord(&frame.longitude), minmea_tocoord(&frame.longitude),
minmea_tofloat(&frame.speed)); minmea_tofloat(&frame.speed));
} }
else {
printf("$xxRMC sentence is not parsed\n");
}
} break; } break;
case MINMEA_SENTENCE_GGA: { case MINMEA_SENTENCE_GGA: {
@ -41,6 +44,9 @@ int main(void)
if (minmea_parse_gga(&frame, line)) { if (minmea_parse_gga(&frame, line)) {
printf("$xxGGA: fix quality: %d\n", frame.fix_quality); printf("$xxGGA: fix quality: %d\n", frame.fix_quality);
} }
else {
printf("$xxGGA sentence is not parsed\n");
}
} break; } break;
case MINMEA_SENTENCE_GST: { case MINMEA_SENTENCE_GST: {
@ -60,6 +66,9 @@ int main(void)
minmea_tofloat(&frame.longitude_error_deviation), minmea_tofloat(&frame.longitude_error_deviation),
minmea_tofloat(&frame.altitude_error_deviation)); minmea_tofloat(&frame.altitude_error_deviation));
} }
else {
printf("$xxGST sentence is not parsed\n");
}
} break; } break;
case MINMEA_SENTENCE_GSV: { case MINMEA_SENTENCE_GSV: {
@ -74,9 +83,17 @@ int main(void)
frame.sats[i].azimuth, frame.sats[i].azimuth,
frame.sats[i].snr); frame.sats[i].snr);
} }
else {
printf("$xxGSV sentence is not parsed\n");
}
} break;
case MINMEA_INVALID: {
printf("$xxxxx sentence is not valid\n");
} break; } break;
default: { default: {
printf("$xxxxx sentence is not parsed\n");
} break; } break;
} }
} }