mirror of
https://github.com/espressif/openthread.git
synced 2026-11-08 07:24:18 +00:00
This commit adds support for the remaining TCP callback, which was not yet supported. Originally, the unimplemented callback was otTcpSendReady, which would indicate to the application when new data added to the TCP send buffer would be sent out immediately. There was also discussion of adding an otTcpBytesAcked callback, which, together with the otTcpSendByExtension() call, would allow a circular buffer to be implemented efficiently on top of the otLinkedBuffer API. Ultimately, it seemed best to generalize the otTcpSendReady callback to include both cases where bytes are acked by the connection peer, and where the send buffer drains, allowing new data to be sent immediately. The reasoning behind this decision is that both the otTcpSendReady and otTcpBytesAcked callbacks are triggered by the same event --- an ACK received from the connection peer --- and that it may require the application to have to "coordinate state" across callbacks. Having a single callback function to indicate both conditions seemed like it could simplify applications significantly. The new, combined, callback is otTcpForwardProgress. This commit implements support and documentation for this callback function.