shadow
shadow

Reputation: 885

How to send queue message to multipule receiver in freeRTOS?

I'm looking for a method to broadcast a message using queue in freeRTOS and i come up with different ideas but each one has a different problem.

what i have:

i'm still thinking about other methods like using new queue or a queue for each receive task but i'm not sure yet which method is the best one. and i don't know if there any other why to broadcast a message even without using the queue technique.

i need to tell you that this program is not for a specific project. i'm just trying to use the Queue technique in different ways. and i already found other post about broadcasting a message but it was for a specific problem where they solve it without using the queue technique. i just want to send "this is a broadcast message" to the queue and all receiver be able to read it once (just one time).

thank you.

Upvotes: 1

Views: 2641

Answers (1)

Richard
Richard

Reputation: 3246

Event groups are the only broadcast mechanism in FreeRTOS. You could use an event group to unblock all tasks that should read from a queue using the queue peek function, then xEventGroupSync() to know when all tasks had read the data so the data should them be removed.

Upvotes: 5

Related Questions