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.
What does this PR do?
This sets a bunch of stuff as
optional
, which allows us to distinguish between a true zero value (for e.g. temperature), encoded as usual with a zero, from an absent value, left out from the encoding.I am guessing a little bit with lots of this. I'd love for stuff like
hops_away
to be able to have this set, so we can distinguish in clients between "old firmware" and "actually 0 hops", and similarly for channel numbers (unset channel on a packet sent to the radio meaning "firmware decides", set-to-0 meaning "actually use channel 0"). Some of that might also necessitate firmware changes, but this is the first step for that in any case.The stuff that I'm pretty sure is good is places like the environmental telemetry, since those are the clearest cases of "this thing could actually be zero".
One other thing I did, which may make whitespace-ignorant diff viewing advisable, is that I ran
dos2unix
ontelemetry.proto
, since it's the only file we have with carriage returns in it. I separated that into a different commit, though, so it might also work to just look at the commit with the actual meat of things.Checklist before merging