Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: gnss: Add geoid separation to gnss_info #84547

Merged
merged 1 commit into from
Jan 29, 2025
Merged
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
10 changes: 10 additions & 0 deletions drivers/gnss/gnss_nmea0183.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,16 @@ int gnss_nmea0183_parse_gga(const char **argv, uint16_t argc, struct gnss_data *
}

data->nav_data.altitude = (int32_t)tmp64;

/* Parse geoid separation */
if ((gnss_parse_dec_to_milli(argv[11], &tmp64) < 0) ||
(tmp64 > INT32_MAX) ||
(tmp64 < INT32_MIN)) {
return -EINVAL;
}

data->info.geoid_separation = (int32_t)tmp64;

return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion include/zephyr/data/navigation.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ struct navigation_data {
uint32_t bearing;
/** Speed in millimeters per second */
uint32_t speed;
/** Altitude in millimeters */
/** Altitude above MSL in millimeters */
int32_t altitude;
};

Expand Down
2 changes: 2 additions & 0 deletions include/zephyr/drivers/gnss.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ struct gnss_info {
uint16_t satellites_cnt;
/** Horizontal dilution of precision in 1/1000 */
uint32_t hdop;
/** Geoid separation in millimeters */
int32_t geoid_separation;
/** The fix status */
enum gnss_fix_status fix_status;
/** The fix quality */
Expand Down
Loading