Closed andrewhodel closed 6 years ago
The structure of the gprmc data is:
typedef struct {
nmea_s base;
nmea_position longitude;
nmea_position latitude;
struct tm time;
} nmea_gprmc_s;
And the members logitude and latitude:
typedef struct {
double minutes;
int degrees;
nmea_cardinal_t cardinal;
} nmea_position;
This means that you should do the following to print the positions using printf:
printf("Longitude:\n");
printf(" Degrees: %d\n", gprmc->longitude.degrees);
printf(" Minutes: %f\n", gprmc->longitude.minutes);
printf(" Cardinal: %c\n", (char) gprmc->longitude.cardinal);
printf("Latitude:\n");
printf(" Degrees: %d\n", gprmc->latitude.degrees);
printf(" Minutes: %f\n", gprmc->latitude.minutes);
printf(" Cardinal: %c\n", (char) gprmc->latitude.cardinal);
If 2 members of nmea_gprmc_s have the same typedef, why wouldn't they both print the same?
This doesn't work, it only prints the latitude.
However if you print the longitude with another printf call, it works.