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
I have some problems with the internal workings of the TCP lib as well, especially I need to implement an error check and a receive check procedure WITHOUT having to send back an ACK to the sender. udp_callback is supposed to return a number, how can I check it, just to start with.
Not quite sure of your problem, the UDP implementation does have a checksum you can enable for basic error checking, but if you want a receive check you will need to have some form of sequence numbers if the order of the data is important, or a timeout routine as a minimum.
Might be easier to use TCP if possible and you can stand the overhead, but thats traded off against the extra code needed around the UDP protocol.
Darren
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
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