New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
generator: mavlink_channel_t with correct length #473
Conversation
For cases where more than 4 mavlink channels are required, the mavlink_channel_t does not match. Therefore, I suggest that the enum needs to be provided separately if the default channel number is not used.
Hey, nice work! This is similar to a PR I opened up a few months ago in response to an issue I made about this ( #404 ). Your change is more along the lines of the fix I was thinking when I made my PR originally. Unfortunately, to preserve backwards compatibility, it may be necessary to maintain the default definition of |
Thanks for the comment @len0rd. I would be happy with either PR. |
@peterbarker Could you please review this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really understand what issue this is solving. Are you really trying to use MAVLINK_COMM_7?
Maybe we should add
#define MAVLINK_COMM_N(n) mavlink_channel_t(MAVLINK_COMM_0+(n))
or we could add:
#ifndef HAVE_MAVLINK_CHANNEL_T
around the enum define, to allow it to be overridden
@tridge thanks for your answer. You're right that it would break existing users that define MAVLINK_COMM_NUM_BUFFERS.
What about doing both? |
This allows to define mavlink_channel_t to match the MAVLINK_COMM_NUM_BUFFERS chosen.
@tridge could you check this again please? Thanks! |
Hi @tridge |
Thanks! |
For cases where more than 4 mavlink channels are required, the mavlink_channel_t does not match. Therefore, I suggest that the enum needs to be provided separately if the default channel number is not used.