CarletonURocketry / fetcher

A QNX process for fetching data from sensors over I2C.
https://carletonurocketry.github.io/fetcher/
GNU General Public License v3.0
1 stars 0 forks source link

Generic type for message queue #37

Open AngusJull opened 1 month ago

AngusJull commented 1 month ago

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 commented 1 month ago

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;