Introduce message types mess_u{8,16,32,64}

Those messages offer a simple array of the given type. This should allow
for fast and simple prototyping.

When a protocol is fixed, then proper message types should be defined.

Change-Id: I4e98eeb0493924f3015862a51d14d894315e2bc2
This commit is contained in:
Lionel Sambuc 2014-04-28 14:21:40 +02:00
parent 7ad108d1e7
commit 97bbdc69df

View file

@ -16,6 +16,26 @@
#define M3_STRING 44 /* legacy m3_ca1 size (must not be changed) */ #define M3_STRING 44 /* legacy m3_ca1 size (must not be changed) */
#define M3_LONG_STRING 44 /* current m3_ca1 size (may be increased) */ #define M3_LONG_STRING 44 /* current m3_ca1 size (may be increased) */
typedef struct {
uint8_t data[56];
} mess_u8;
_ASSERT_MSG_SIZE(mess_u8);
typedef struct {
uint16_t data[28];
} mess_u16;
_ASSERT_MSG_SIZE(mess_u16);
typedef struct {
uint32_t data[14];
} mess_u32;
_ASSERT_MSG_SIZE(mess_u32);
typedef struct {
uint64_t data[7];
} mess_u64;
_ASSERT_MSG_SIZE(mess_u64);
typedef struct { typedef struct {
uint64_t m1ull1; uint64_t m1ull1;
int m1i1, m1i2, m1i3; int m1i1, m1i2, m1i3;
@ -186,6 +206,11 @@ typedef struct {
endpoint_t m_source; /* who sent the message */ endpoint_t m_source; /* who sent the message */
int m_type; /* what kind of message is it */ int m_type; /* what kind of message is it */
union { union {
mess_u8 m_u8;
mess_u16 m_u16;
mess_u32 m_u32;
mess_u64 m_u64;
mess_1 m_m1; mess_1 m_m1;
mess_2 m_m2; mess_2 m_m2;
mess_3 m_m3; mess_3 m_m3;