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 navigation_data #84547

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
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->nav_data.geoid_separation = (int32_t)tmp64;

return 0;
}

Expand Down
4 changes: 3 additions & 1 deletion include/zephyr/data/navigation.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ 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;
/** Geoid separation in millimeters */
int32_t geoid_separation;
};

/**
Expand Down
Loading