otTcpCircularSendBuffer Struct Reference

This structure represents a circular send buffer for use with a TCP endpoint.

#include <include/openthread/tcp_ext.h>

Public Attributes

const uint8_t * mDataBuffer
 Pointer to data in the circular send buffer.
 
size_t mCapacity
 Length of the circular send buffer.
 
size_t mStartIndex
 Index of the first valid byte in the send buffer.
 
size_t mCapacityUsed
 Number of bytes stored in the send buffer.
 
otLinkedBuffer mSendLinks [2]
 
uint8_t mFirstSendLinkIndex

This structure represents a circular send buffer for use with a TCP endpoint.

Using a circular send buffer is optional. Applications can use a TCP endpoint to send data by managing otLinkedBuffers directly. However, some applications may find it more convenient to have a circular send buffer; such applications can call otTcpCircularSendBufferWrite() to "attach" a circular send buffer to a TCP endpoint and send out data on that TCP endpoint, relying on the circular send buffer to manage the underlying otLinkedBuffers.

otTcpCircularSendBuffer is implemented on top of the otLinkedBuffer-based API provided by an otTcpEndpoint. Once attached to an otTcpEndpoint, an otTcpCircularSendBuffer performs all the work of managing otLinkedBuffers for the connection. This means that, once an otTcpCircularSendBuffer is attached to an otTcpEndpoint, the application should not call otTcpSendByReference() or otTcpSendByExtension() on that otTcpEndpoint. Instead, the application should use otTcpCircularSendBufferWrite() to add data to the send buffer.

The otTcpForwardProgress() callback is the intended way for users to learn when space becomes available in the circular send buffer. On an otTcpEndpoint to which an otTcpCircularSendBuffer is attached, the application MUST install an otTcpForwardProgress() callback and call otTcpCircularSendBufferHandleForwardProgress() on the attached otTcpCircularSendBuffer at the start of the callback function. It is recommended that the user NOT install an otTcpSendDone() callback, as all management of otLinkedBuffers is handled by the circular send buffer.

The application should not inspect the fields of this structure directly; it should only interact with it via the TCP Circular Send Buffer API functions whose signature are provided in this file.


The documentation for this struct was generated from the following file:
  • include/openthread/tcp_ext.h