CCS v5.4
TI-RTOS 1.10.00.23
F28M35H52C1 Experimenter Kit
I’m just starting to use TI-RTOS for the first time on a Concerto F28M35H52C1 Experimenter Kit. I’m designing an application for the ARM core and I would like to use the MessageQ IPC to send data between threads within that same core. From what I’ve read, the MessageQ is supposed to support sending and receiving of variable length messages, but I'm confused as how to implement this after looking for examples. I’ve seen example code where a structure for a message is defined something like this:
typedef struct MyMsg {
MessageQ_MsgHeader header;
int MyData[10];
} MyMsg;
After the message is sent from one thread, Another thread receives the message with something like this:
MyMsg msg;
status = MessageQ_get(message, &msg, MessageQ_FOREVER);
From this code, it appears the MessageQ_get expects a fixed sized message based on the size of the MyMsg structure.
If I have a second structure defined as follows
typedef struct MyMsg2
MessageQ_MsgHeader header;
float MyData[100];
} MyMsg2;
how could I send either MyMsg or MyMsg2 through the same MessageQ, if the MessageQ_get call needs to specify a buffer defined as a fixed size structure to hold the message? Would this require a separate message queue for each message of a different length?
Thanks in advance for any help.