Modules#
Message Pool#
This module includes the platform abstraction for the message pool.
Typedefs#
This struct represents an OpenThread message buffer.
Functions#
Initialize the platform implemented message pool.
Allocate a buffer from the platform managed buffer pool.
This function is used to free a buffer back to the platform managed buffer pool.
Get the number of free buffers.
Typedef Documentation#
otMessageBuffer#
typedef struct otMessageBuffer otMessageBuffer
This struct represents an OpenThread message buffer.
Function Documentation#
otPlatMessagePoolInit#
void otPlatMessagePoolInit (otInstance * aInstance, uint16_t aMinNumFreeBuffers, size_t aBufferSize)
Initialize the platform implemented message pool.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to the OpenThread instance. |
uint16_t | [in] | aMinNumFreeBuffers | An uint16 containing the minimum number of free buffers desired by OpenThread. |
size_t | [in] | aBufferSize | The size in bytes of a buffer object. |
This function is used when OPENTHREAD_CONFIG_PLATFORM_MESSAGE_MANAGEMENT
is enabled.
otPlatMessagePoolNew#
otMessageBuffer * otPlatMessagePoolNew (otInstance * aInstance)
Allocate a buffer from the platform managed buffer pool.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to the OpenThread instance. |
This function 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.
otPlatMessagePoolFree#
void otPlatMessagePoolFree (otInstance * aInstance, otMessageBuffer * aBuffer)
This function is used to free a buffer back to the platform managed buffer pool.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to the OpenThread instance. |
otMessageBuffer * | [in] | aBuffer | The buffer to free. |
This function is used when OPENTHREAD_CONFIG_PLATFORM_MESSAGE_MANAGEMENT
is enabled.
otPlatMessagePoolNumFreeBuffers#
uint16_t otPlatMessagePoolNumFreeBuffers (otInstance * aInstance)
Get the number of free buffers.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | A pointer to the OpenThread instance. |
This function is used when OPENTHREAD_CONFIG_PLATFORM_MESSAGE_MANAGEMENT
is enabled.
Returns
The number of buffers currently free and available to OpenThread.