sparkfun / sparkfun/SparkFun_u-blox_GNSS_Arduino_Library
[Feature Request] enableGNSS - using combined constellations
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 286
- Forks
- 114
- PR merge metrics
- No merged PRs in 30d
Description
Subject of the issue
The functions for getting/setting the GNSS enabling take a variable of type enum sfe_ublox_gnss_ids_e
However, the implementation indicates a little different use with combined values of this type. So if you want to enable GPS and Galileo you would send SFE_UBLOX_GNSS_ID_GPS | SFE_UBLOX_GNSS_ID_GALILEO but this will result in a warning as this combined value is not a member of the enum. So I'd suggest to change the type to int. As the functions check the actual values anyway, it would not matter if illegal combinations are sent.
However, the isGNSSenabled function does check for all values being set in the parameter, but the result only shows if at least one of those values is enabled. I guess that's not meant, as in that case the true value could immediately be returned. Instead, you should return false immediately if one of the values is not set. That way, all values are properly checked for all being activated.
There is no specific board or module required, it's just being based on code review.
Expected behavior
OR combined enum values should be accepted, as code already deals with it
check for being enabled should return true only if all OR combined GNSS types are activated
Actual behavior
compiler raises warning/error with OR combination
Check function returns true if at least one type is activated
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the enableGNSS and isGNSSenabled implementations and the sfe_ublox_gnss_ids_e definition. Verify how OR-combined GNSS values are accepted and checked, then add or update the relevant tests so completion means combined values compile and isGNSSenabled returns true only when every requested constellation is enabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- arduino, cpp
- Domain
- embedded-iot
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100