Use of os_xx_functions in callbacks

Is it safe to use such functions as os_mbx_send inside a call back function ie. udp_callback from the TCP stack, i have this working and all seems ok, i am passing messages from the udp socket inside my tcp_task , to a serial port handled via another task.

However, i am now trying to pass messages from the cgi_function callback again in the tcp_task, to my serial port task, this works to a point, it appears the messages are sent to the serial port handler i can see the messages on the wire with my serial monitor and the reply messages are going back, the other way from the serial port to the tcp_task mailbox, i can see the pointer in the mailbox. But the task appear to be locked, my other tasks are still run the i have task hadling the timer function for the TCP stack this is still active, in the RTX monitor the tcp_task states it is ready, it is as if the TCP task has been left in a locked state.

Still looking deeper but just wanted confirmation that its safe to call os_mbx_send from the callback functions.

best regards
Darren

Parents
  • Think i have figured out what is happening, i had the set the cgi_function to loop return mask or'ed 0x8000. I was assuming it would complete the task and then call the cgi_function again on the next cycle of the TCP task. Instead it looks like its sat in a loop within the call to the cgi_function, so i should be able to get it to wait within the cgi_function itself for an event that the data is ready (have to get live data in realtime). I am still worried this is blocking the rest of the tcp stack functionality i.e. incoming UDP data anybody have any deeper knowledge of the internal workings of the TCP lib.

    best regards
    Darren

Reply
  • Think i have figured out what is happening, i had the set the cgi_function to loop return mask or'ed 0x8000. I was assuming it would complete the task and then call the cgi_function again on the next cycle of the TCP task. Instead it looks like its sat in a loop within the call to the cgi_function, so i should be able to get it to wait within the cgi_function itself for an event that the data is ready (have to get live data in realtime). I am still worried this is blocking the rest of the tcp stack functionality i.e. incoming UDP data anybody have any deeper knowledge of the internal workings of the TCP lib.

    best regards
    Darren

Children
More questions in this forum