消息池
此模块包含消息池的平台抽象。
摘要
类型定义符 |
|
|---|---|
otMessageBuffer
|
typedefstruct otMessageBuffer
表示 OpenThread 消息缓冲区。 |
函数 |
|
|---|---|
otPlatMessagePoolFree(otInstance *aInstance, otMessageBuffer *aBuffer)
|
void
用于将缓冲区释放回平台管理的缓冲池。
|
otPlatMessagePoolInit(otInstance *aInstance, uint16_t aMinNumFreeBuffers, size_t aBufferSize)
|
void
初始化平台实现的消息池。
|
otPlatMessagePoolNew(otInstance *aInstance)
|
从平台管理的缓冲区池中分配缓冲区。
|
otPlatMessagePoolNumFreeBuffers(otInstance *aInstance)
|
uint16_t
获取可用缓冲区的数量。
|
结构体 |
|
|---|---|
| otMessageBuffer |
表示 OpenThread 消息缓冲区。 |
类型定义符
函数
otPlatMessagePoolFree
void otPlatMessagePoolFree( otInstance *aInstance, otMessageBuffer *aBuffer )
用于将缓冲区释放回平台管理的缓冲池。
在启用 OPENTHREAD_CONFIG_PLATFORM_MESSAGE_MANAGEMENT 时使用。
| 具体说明 | |||||
|---|---|---|---|---|---|
| 参数 |
|
||||
otPlatMessagePoolInit
void otPlatMessagePoolInit( otInstance *aInstance, uint16_t aMinNumFreeBuffers, size_t aBufferSize )
初始化平台实现的消息池。
在启用 OPENTHREAD_CONFIG_PLATFORM_MESSAGE_MANAGEMENT 时使用。
| 具体说明 | |||||||
|---|---|---|---|---|---|---|---|
| 参数 |
|
||||||
otPlatMessagePoolNew
otMessageBuffer * otPlatMessagePoolNew( otInstance *aInstance )
从平台管理的缓冲区池中分配缓冲区。
在启用 OPENTHREAD_CONFIG_PLATFORM_MESSAGE_MANAGEMENT 时使用。
返回的缓冲区实例必须至少包含 aBufferSize 个字节(如 otPlatMessagePoolInit() 中所指定)。
| 具体说明 | |||
|---|---|---|---|
| 参数 |
|
||
| 返回值 |
指向缓冲区的指针,如果没有可用的缓冲区,则为 NULL。
|
||
otPlatMessagePoolNumFreeBuffers
uint16_t otPlatMessagePoolNumFreeBuffers( otInstance *aInstance )
获取可用缓冲区的数量。
在启用 OPENTHREAD_CONFIG_PLATFORM_MESSAGE_MANAGEMENT 时使用。
| 具体说明 | |||
|---|---|---|---|
| 参数 |
|
||
| 返回值 |
当前空闲且可供 OpenThread 使用的缓冲区数。
|
||
资源
OpenThread API 参考文档源自 GitHub 上提供的源代码。如需了解详情,或者为我们的文档做贡献,请参阅资源。