[SOLVED] Are WM_MESSAGEs sent witch WM_BroadcastMessage() serialized ?

  • As title says, are WM_MESSAGEs sent with WM_BroadcastMessage() serialized and queued somewhere until consumed or the WM_MESSAGE
    structure passed to WM_BroadcastMessage() must be valid till the message is consumed?
    For example, is the following code legit:

    Code
    void SendSignal(const int id, const int v, void *p)
    {
    	WM_MESSAGE msg;
    
    
    	msg.MsgId = id;
    	msg.Data.p = p;
    	msg.Data.v = v;
    	WM_BroadcastMessage(&msg);
    }

    or should WM_MESSAGE be declared static ?
    This would imply I can send only one message at a time and wait until the message is consumed
    before sending another one (or else I must manage myself a message queue).
    This behavior is not documented anywhere as far as i can tell.

    Best regards, Gabriele.

    Edited once, last by Gabri74 (March 31, 2016 at 11:28 AM).

  • Hi,

    Your function is legit. WM_BroadcastMessage() sends its own copy of the given message.

    Regards,
    Jörg

    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: https://www.segger.com/ticket/

    Or you can contact us via e-mail.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!