Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions minmea.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ struct minmea_sentence_gga {
struct minmea_float dgps_age;
};

enum minmea_gga_fix_quality {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we be updating the structures that have a fix quality to use this enum type now that it exists? That would ensure type safety as well.

MINMEA_GGA_FIX_QUALITY_NO_FIX = 0,
MINMEA_GGA_FIX_QUALITY_GPS = 1,
MINMEA_GGA_FIX_QUALITY_DIFFERENTIAL_GPS = 2,
MINMEA_GGA_FIX_QUALITY_RTK_FIXED = 4,
MINMEA_GGA_FIX_QUALITY_RTK_FLOAT = 5,
MINMEA_GGA_FIX_QUALITY_ESTIMATED_DR = 6
};

enum minmea_gll_status {
MINMEA_GLL_STATUS_DATA_VALID = 'A',
MINMEA_GLL_STATUS_DATA_NOT_VALID = 'V',
Expand Down
4 changes: 2 additions & 2 deletions tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ START_TEST(test_minmea_scan_complex1)
ck_assert_int_eq(longitude.value, 1131000);
ck_assert_int_eq(longitude.scale, 1000);
ck_assert_int_eq(longitude_direction, 1);
ck_assert_int_eq(fix_quality, 1);
ck_assert_int_eq(fix_quality, MINMEA_GGA_FIX_QUALITY_GPS);
ck_assert_int_eq(satellites, 8);
ck_assert_int_eq(hdop.value, 9);
ck_assert_int_eq(hdop.scale, 10);
Expand Down Expand Up @@ -562,7 +562,7 @@ START_TEST(test_minmea_parse_gga1)
expected.time = (struct minmea_time) { 12, 35, 19, 0 };
expected.latitude = (struct minmea_float) { 4807038, 1000 };
expected.longitude = (struct minmea_float) { 1131000, 1000 };
expected.fix_quality = 1;
expected.fix_quality = MINMEA_GGA_FIX_QUALITY_GPS;
expected.satellites_tracked = 8;
expected.hdop = (struct minmea_float) { 9, 10 };
expected.altitude = (struct minmea_float) { 5454, 10 };
Expand Down