Allow GPS serial port to be specified as argument to gps
example
#2969
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds the ability to specify the GPS's serial port in the
gps
example, instead of only being able to use/dev/ttyS1
. It also marks the MINMEA library as a dependency for thegps
example.Impact
Now that MINMEA is marked as a dependency, the
gps
example is unfortunately not visible in the list of applications until MINMEA is available. However, I wanted to avoid the use ofselect
in Kconfig since it will not recursively enable dependencies.The user is now also able to run the
gps
example with a serial port for the GPS specified, supporting this example on boards where the serial port is different. I have left/dev/ttyS1
as the default when no port is specified to keep backward compatibility.Closes #2966.
Testing
Tested this example with a board that has GPS on
/dev/ttyS0
and it worked as expected. I also tried specifying a bad path and the program exited gracefully with the error.