This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

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
  • Thank you for replying :) !

    Can't use the TCP protocol for speed reason :(
    The biggest problem with the library is that data receiving is performed via callbacks, so the biggest issue is, what if no data is received? Windows or Linux - BSD - socket routines have implemented checks and returned error codes, such as wrong address, connex timeout and so on, what about Keil tcp library? Extra code doesn't scare me that much, but I'm wondering why some flags DO exist if they cannot be used in a proper way...wondering if I'm missing smtg.

    Sarah

Reply
  • Thank you for replying :) !

    Can't use the TCP protocol for speed reason :(
    The biggest problem with the library is that data receiving is performed via callbacks, so the biggest issue is, what if no data is received? Windows or Linux - BSD - socket routines have implemented checks and returned error codes, such as wrong address, connex timeout and so on, what about Keil tcp library? Extra code doesn't scare me that much, but I'm wondering why some flags DO exist if they cannot be used in a proper way...wondering if I'm missing smtg.

    Sarah

Children
  • With UDP you receive callback as data arrives thats it, no data no call back. Its a connectionless protocol so no time out messages from the stack itself, if you want timeouts then you need to add them to your application code.

    Still not 100% on your application.

    regards
    Darren