Message Pool#

This module includes the platform abstraction for the message pool.

Modules#

otMessageBuffer

Typedefs#

typedef struct otMessageBuffer

Represents an OpenThread message buffer.

Functions#

void
otPlatMessagePoolInit(otInstance *aInstance, uint16_t aMinNumFreeBuffers, size_t aBufferSize)

Initialize the platform implemented message pool.

otPlatMessagePoolNew(otInstance *aInstance)

Allocate a buffer from the platform managed buffer pool.

void
otPlatMessagePoolFree(otInstance *aInstance, otMessageBuffer *aBuffer)

Is used to free a buffer back to the platform managed buffer pool.

uint16_t
otPlatMessagePoolNumFreeBuffers(otInstance *aInstance)

Get the number of free buffers.

Typedef Documentation#

otMessageBuffer#

typedef struct otMessageBuffer otMessageBuffer

Represents an OpenThread message buffer.


Definition at line 63 of file include/openthread/platform/messagepool.h

Function Documentation#

otPlatMessagePoolInit#

void otPlatMessagePoolInit (otInstance * aInstance, uint16_t aMinNumFreeBuffers, size_t aBufferSize)

Initialize the platform implemented message pool.

Parameters
[in]aInstance

A pointer to the OpenThread instance.

[in]aMinNumFreeBuffers

An uint16 containing the minimum number of free buffers desired by OpenThread.

[in]aBufferSize

The size in bytes of a buffer object.

Is used when OPENTHREAD_CONFIG_PLATFORM_MESSAGE_MANAGEMENT is enabled.


Definition at line 75 of file include/openthread/platform/messagepool.h

otPlatMessagePoolNew#

otMessageBuffer * otPlatMessagePoolNew (otInstance * aInstance)

Allocate a buffer from the platform managed buffer pool.

Parameters
[in]aInstance

A pointer to the OpenThread instance.

Is used when OPENTHREAD_CONFIG_PLATFORM_MESSAGE_MANAGEMENT is enabled.

The returned buffer instance MUST have at least aBufferSize bytes (as specified in otPlatMessagePoolInit()).

Returns

  • A pointer to the buffer or NULL if no buffers are available.


Definition at line 89 of file include/openthread/platform/messagepool.h

otPlatMessagePoolFree#

void otPlatMessagePoolFree (otInstance * aInstance, otMessageBuffer * aBuffer)

Is used to free a buffer back to the platform managed buffer pool.

Parameters
[in]aInstance

A pointer to the OpenThread instance.

[in]aBuffer

The buffer to free.

Is used when OPENTHREAD_CONFIG_PLATFORM_MESSAGE_MANAGEMENT is enabled.


Definition at line 100 of file include/openthread/platform/messagepool.h

otPlatMessagePoolNumFreeBuffers#

uint16_t otPlatMessagePoolNumFreeBuffers (otInstance * aInstance)

Get the number of free buffers.

Parameters
[in]aInstance

A pointer to the OpenThread instance.

Is used when OPENTHREAD_CONFIG_PLATFORM_MESSAGE_MANAGEMENT is enabled.

Returns

  • The number of buffers currently free and available to OpenThread.


Definition at line 112 of file include/openthread/platform/messagepool.h