A couple of community members in M17 discord pointed out that the mode lookup table was misleadingly unexpanded given that the field had an entire byte. Fix this. I also discovered, more significantly, that the value of this table had an off-by-one error as a consequence of an inconsistency between the draft specification, which had included a typedef for this field, and the actual implementation in OpenRTX. Ill focus the rest of this PR explaining this.
Why
When researching how the native CPS is implemented in openrtx, I noticed that channel_t is shared with present day native CPS and openrtx codeplug formats. This is when I discovered that the enum opmode definition is the proper definition for this mode field, which specifies that 0 is OPMODE_NONE, not OPMODE_FM.
How
Expand the lookup table to a byte
Insert a new 0b0 value for "None" and document its use as a matter of compatibility for an indeterminate state
Next steps
Confirm this is actually a bug; Im not clear if this "none" state is actually valuable given that we could catch these indeterminate state in the software generating the codeplugs rather than passing the burden of supporting it down to the radios; since the typedef isnt clear, I've taken the "conservative" approach for now, but this is not such a straight forward decision; this change supports what's implemented in openrtx today, but I'm not clear if that's the right decision
Increment the version to v0.2.0 as this is clearly a breaking change, but the standard is not yet "general release"
I have not done this last step, as we may want to delay and bundle a number of fixes together in a single version to avoid churn. Leaving this consideration to the maintainers.
What
A couple of community members in M17 discord pointed out that the mode lookup table was misleadingly unexpanded given that the field had an entire byte. Fix this. I also discovered, more significantly, that the value of this table had an off-by-one error as a consequence of an inconsistency between the draft specification, which had included a typedef for this field, and the actual implementation in OpenRTX. Ill focus the rest of this PR explaining this.
Why
When researching how the native CPS is implemented in openrtx, I noticed that
channel_t
is shared with present day native CPS and openrtx codeplug formats. This is when I discovered that theenum opmode
definition is the proper definition for this mode field, which specifies that 0 is OPMODE_NONE, not OPMODE_FM.How
Next steps
I have not done this last step, as we may want to delay and bundle a number of fixes together in a single version to avoid churn. Leaving this consideration to the maintainers.