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.

Public Attributes#

uint8_t *

Pointer to data in the circular send buffer.

size_t

Length of the circular send buffer.

size_t

Index of the first valid byte in the send buffer.

size_t

Number of bytes stored in the send buffer.

Public Attribute Documentation#

mDataBuffer#

uint8_t* otTcpCircularSendBuffer::mDataBuffer

Pointer to data in the circular send buffer.


Definition at line 91 of file include/openthread/tcp_ext.h

mCapacity#

size_t otTcpCircularSendBuffer::mCapacity

Length of the circular send buffer.


Definition at line 92 of file include/openthread/tcp_ext.h

mStartIndex#

size_t otTcpCircularSendBuffer::mStartIndex

Index of the first valid byte in the send buffer.


Definition at line 93 of file include/openthread/tcp_ext.h

mCapacityUsed#

size_t otTcpCircularSendBuffer::mCapacityUsed

Number of bytes stored in the send buffer.


Definition at line 94 of file include/openthread/tcp_ext.h

mSendLinks#

otLinkedBuffer otTcpCircularSendBuffer::mSendLinks[2]

Definition at line 96 of file include/openthread/tcp_ext.h

mFirstSendLinkIndex#

uint8_t otTcpCircularSendBuffer::mFirstSendLinkIndex

Definition at line 97 of file include/openthread/tcp_ext.h