This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Different message sizes on Desktop Linux SDK



I would like to send custom messages via the mailbox utility.  It looks like mailBox_read copies the next message into the pointer location.  However, since my messages could be of different sizes, how can I make sure that if the next message is larger than the memory pointed to, I will not clobber good memory?

One suggestion would be to have a routine mailBox_query_message_size that returns the size of the next message but does not free the node and does not copy the body of the message.

Is this how I should implement it?

  • Hi Syndey,

    As you notice the mailBox is designed specially for small messages. If you are using the 01.00.00.02 alpha release, the mailbox message maximum size is limited to

    #define MAILBOX_MAX_PAYLOAD         116

    sdk/config/host_dsp_xchg_cfg.h. (the latest alpha release , this is init-time  configurable).

    Now on the mailBox read, if you are  expecting multiple size messages, probably it is recommended to  have memory allocated for the maximum size expected to keep it simple.