Skip to content
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

Make embedded module public #210

Merged

Conversation

antonio-sc66
Copy link
Contributor

@antonio-sc66 antonio-sc66 commented Dec 12, 2023

Embedded module redefines the Write and Read traits.

Right now it's a private module, when the library is compiled in embedded mode, the following problem occurs :

imagen

Write is non-accesible, both while checking the documentation, but more important, when you integrate this library into your code, you can't define a function that receives an argument that needs to implement the custom Read or Write trait.

Example:

pub fn send_command<W: Write>(
    &mut self,
    cmd: FooCommandMsgType,
    writer: &mut W,
) -> Result<u16, FooError> {

...

write_v2_msg(
                writer,
                foo_header,
                &foo_message,
            ),

...

The following cases only work when compiled in normal (non-embedded) modes.

lib. Make embedded module public so that traits can be used externally
@patrickelectric patrickelectric merged commit 9353461 into mavlink:master Dec 12, 2023
25 checks passed
@antonio-sc66 antonio-sc66 deleted the feature-public-embedded branch December 12, 2023 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants