example.c: fix printed frame names

This commit is contained in:
Kosma Moczek 2014-04-27 16:38:06 +02:00
parent 870d64d1d5
commit e510d9912e

View File

@ -21,15 +21,15 @@ int main()
case MINMEA_SENTENCE_RMC: { case MINMEA_SENTENCE_RMC: {
struct minmea_sentence_rmc frame; struct minmea_sentence_rmc frame;
if (minmea_parse_rmc(&frame, line)) { if (minmea_parse_rmc(&frame, line)) {
printf("+++ raw coordinates and speed: (%d/%d,%d/%d) %d/%d\n", printf("$xxRMC: raw coordinates and speed: (%d/%d,%d/%d) %d/%d\n",
frame.latitude.value, frame.latitude.scale, frame.latitude.value, frame.latitude.scale,
frame.longitude.value, frame.longitude.scale, frame.longitude.value, frame.longitude.scale,
frame.speed.value, frame.speed.scale); frame.speed.value, frame.speed.scale);
printf("+++ fixed-point coordinates and speed scaled to three decimal places: (%d,%d) %d\n", printf("$xxRMC fixed-point coordinates and speed scaled to three decimal places: (%d,%d) %d\n",
minmea_rescale(&frame.latitude, 1000), minmea_rescale(&frame.latitude, 1000),
minmea_rescale(&frame.longitude, 1000), minmea_rescale(&frame.longitude, 1000),
minmea_rescale(&frame.speed, 1000)); minmea_rescale(&frame.speed, 1000));
printf("+++ floating point degree coordinates and speed: (%f,%f) %f\n", printf("$xxRMC floating point degree coordinates and speed: (%f,%f) %f\n",
minmea_tocoord(&frame.latitude), minmea_tocoord(&frame.latitude),
minmea_tocoord(&frame.longitude), minmea_tocoord(&frame.longitude),
minmea_tofloat(&frame.speed)); minmea_tofloat(&frame.speed));
@ -39,23 +39,23 @@ int main()
case MINMEA_SENTENCE_GGA: { case MINMEA_SENTENCE_GGA: {
struct minmea_sentence_gga frame; struct minmea_sentence_gga frame;
if (minmea_parse_gga(&frame, line)) { if (minmea_parse_gga(&frame, line)) {
printf("$GPGGA: fix quality: %d\n", frame.fix_quality); printf("$xxGGA: fix quality: %d\n", frame.fix_quality);
} }
} break; } break;
case MINMEA_SENTENCE_GST: { case MINMEA_SENTENCE_GST: {
struct minmea_sentence_gst frame; struct minmea_sentence_gst frame;
if (minmea_parse_gst(&frame, line)) { if (minmea_parse_gst(&frame, line)) {
printf("+++ raw latitude,longitude and altitude error deviation: (%d/%d,%d/%d,%d/%d)\n", printf("$xxGST: raw latitude,longitude and altitude error deviation: (%d/%d,%d/%d,%d/%d)\n",
frame.latitude_error_deviation.value, frame.latitude_error_deviation.scale, frame.latitude_error_deviation.value, frame.latitude_error_deviation.scale,
frame.longitude_error_deviation.value, frame.longitude_error_deviation.scale, frame.longitude_error_deviation.value, frame.longitude_error_deviation.scale,
frame.altitude_error_deviation.value, frame.altitude_error_deviation.scale); frame.altitude_error_deviation.value, frame.altitude_error_deviation.scale);
printf("+++ fixed point latitude,longitude and altitude error deviation \ printf("$xxGST fixed point latitude,longitude and altitude error deviation \
scaled to one decimal place: (%d,%d,%d)\n", scaled to one decimal place: (%d,%d,%d)\n",
minmea_rescale(&frame.latitude_error_deviation, 10), minmea_rescale(&frame.latitude_error_deviation, 10),
minmea_rescale(&frame.longitude_error_deviation, 10), minmea_rescale(&frame.longitude_error_deviation, 10),
minmea_rescale(&frame.altitude_error_deviation, 10)); minmea_rescale(&frame.altitude_error_deviation, 10));
printf("+++ floating point degree latitude, longitude and altitude error deviation: (%f,%f,%f)", printf("$xxGST floating point degree latitude, longitude and altitude error deviation: (%f,%f,%f)",
minmea_tofloat(&frame.latitude_error_deviation), minmea_tofloat(&frame.latitude_error_deviation),
minmea_tofloat(&frame.longitude_error_deviation), minmea_tofloat(&frame.longitude_error_deviation),
minmea_tofloat(&frame.altitude_error_deviation)); minmea_tofloat(&frame.altitude_error_deviation));
@ -65,10 +65,10 @@ int main()
case MINMEA_SENTENCE_GSV: { case MINMEA_SENTENCE_GSV: {
struct minmea_sentence_gsv frame; struct minmea_sentence_gsv frame;
if (minmea_parse_gsv(&frame, line)) { if (minmea_parse_gsv(&frame, line)) {
printf("$GPGSV: message %d of %d\n", frame.msg_nr, frame.total_msgs); printf("$xxGSV: message %d of %d\n", frame.msg_nr, frame.total_msgs);
printf("$GPGSV: sattelites in view: %d\n", frame.total_sats); printf("$xxGSV: sattelites in view: %d\n", frame.total_sats);
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
printf("$GPGSV: sat nr %d, elevation: %d, azimuth: %d, snr: %d dbm\n", printf("$xxGSV: sat nr %d, elevation: %d, azimuth: %d, snr: %d dbm\n",
frame.sats[i].nr, frame.sats[i].nr,
frame.sats[i].elevation, frame.sats[i].elevation,
frame.sats[i].azimuth, frame.sats[i].azimuth,