MavSchema: Allow 64-bit enum values to be specified #915
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.
Within the Mavlink schema, enum values are currently limited to 10 decimal, 8 hex, or 32 binary digits.
However, we already have two fields which are bitmasks and use uint64_t type (AUTOPILOT_VERSION.capabilities and GENERATOR_STATUS.status). This character limit means that you can't currently specify a value using (most of) the higher 32-bits.
I came across this while trying to build a test case for #895.
My proposal is to extend the character limit to 20 decimal, 16 hex or 64 binary digits to allow for this.
@hamishwillee - does this make sense?
I did wonder if it might be useful to be allowed to specify values as powers of 2 (e.g. "2^0", "2^4", "2^55") to be more readable as the numbers get bigger, but as this would require work on the generators, so have not proposed it.
I also wondered if the test.xml file in Mavlink repo should include at least one enum and bitmask, if it is supposed to be used a nice little test file cover major functionality?