I have my main_thread which is the GUI that displays data and reacts to touch events and another thread the does some calculations based on the RTC and a algorithm. I would like to pass the data from the RTC thread to the main_thread. I created a custom messaging event class that holds a pointer to the data. My main thread already looks for updates in the main_thread_message_queue but I am unsure how to put my data in the queue. I know that you have to acquire the buffer, write the message then post. Is there some example code for doing these three tasks? ( The relationship between sf_message_header_t in the API call and my struct is confusing) This is my structure ...
typedef struct angle_payload_t
{
sf_message_header_t header; ///< Required header for messaging framework.
angle_data_t * angleData;
} angle_payload_t;
And the setup code...
outputDataMessage.header.event_b.class_code = SF_MESSAGE_EVENT_CLASS_ANGLE;
outputDataMessage.header.event_b.code = SF_MESSAGE_EVENT_NEW_DATA;
outputDataMessage.header.event_b.class_instance = 0;
outputDataMessage.angleData = &outputData;
Where outputData is the staticly defined data that I want in the main thread from the messaging structure.
How do I "push" this data into the buffer?