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

Generic type for message queue #37

Open
AngusJull opened this issue May 15, 2024 · 1 comment
Open

Generic type for message queue #37

AngusJull opened this issue May 15, 2024 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@AngusJull
Copy link
Contributor

The collectors currently send data using their own privately defined structs. These should be swapped for a single definition (likely making use of the types in the sensor interface).

@linguini1
Copy link
Collaborator

This is implemented with the types in sensor_api.h where all types are shared. The types I think you're seeing in the collectors are just unions that make sending easier with a uint8_t type header member.

I do like the idea of a union for this that's common and contains all the types:

typedef struct {
    uint8_t type;
    union {
        float fl;
        uint32_t u32;
        vec3d_t v3;
        /* ... more types ... */
    } data;
} sensor_msg_t;

@linguini1 linguini1 added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants