![]() |
0.01.00
|
This module includes functions that manipulate OpenThread message buffers. More...
Classes | |
struct | otMessageQueue |
This structure represents an OpenThread message queue. More... | |
Functions | |
void | otMessageFree (otMessage *aMessage) |
Free an allocated message buffer. More... | |
uint16_t | otMessageGetLength (otMessage *aMessage) |
Get the message length in bytes. More... | |
otError | otMessageSetLength (otMessage *aMessage, uint16_t aLength) |
Set the message length in bytes. More... | |
uint16_t | otMessageGetOffset (otMessage *aMessage) |
Get the message offset in bytes. More... | |
otError | otMessageSetOffset (otMessage *aMessage, uint16_t aOffset) |
Set the message offset in bytes. More... | |
bool | otMessageIsLinkSecurityEnabled (otMessage *aMessage) |
This function indicates whether or not link security is enabled for the message. More... | |
void | otMessageSetDirectTransmission (otMessage *aMessage, bool aEnabled) |
This function sets/forces the message to be forwarded using direct transmission. More... | |
int8_t | otMessageGetRss (otMessage *aMessage) |
This function returns the average RSS (received signal strength) associated with the message. More... | |
otError | otMessageAppend (otMessage *aMessage, const void *aBuf, uint16_t aLength) |
Append bytes to a message. More... | |
int | otMessageRead (otMessage *aMessage, uint16_t aOffset, void *aBuf, uint16_t aLength) |
Read bytes from a message. More... | |
int | otMessageWrite (otMessage *aMessage, uint16_t aOffset, const void *aBuf, uint16_t aLength) |
Write bytes to a message. More... | |
void | otMessageQueueInit (otMessageQueue *aQueue) |
Initialize the message queue. More... | |
otError | otMessageQueueEnqueue (otMessageQueue *aQueue, otMessage *aMessage) |
This function adds a message to the end of the given message queue. More... | |
otError | otMessageQueueEnqueueAtHead (otMessageQueue *aQueue, otMessage *aMessage) |
This function adds a message at the head/front of the given message queue. More... | |
otError | otMessageQueueDequeue (otMessageQueue *aQueue, otMessage *aMessage) |
This function removes a message from the given message queue. More... | |
otMessage * | otMessageQueueGetHead (otMessageQueue *aQueue) |
This function returns a pointer to the message at the head of the queue. More... | |
otMessage * | otMessageQueueGetNext (otMessageQueue *aQueue, const otMessage *aMessage) |
This function returns a pointer to the next message in the queue by iterating forward (from head to tail). More... | |
OTAPI void OTCALL | otMessageGetBufferInfo (otInstance *aInstance, otBufferInfo *aBufferInfo) |
Get the Message Buffer information. More... | |
This module includes functions that manipulate OpenThread message buffers.
Append bytes to a message.
[in] | aMessage | A pointer to a message buffer. |
[in] | aBuf | A pointer to the data to append. |
[in] | aLength | Number of bytes to append. |
OT_ERROR_NONE | Successfully appended to the message |
OT_ERROR_NO_BUFS | No available buffers to grow the message. |
void otMessageFree | ( | otMessage * | aMessage | ) |
Free an allocated message buffer.
[in] | aMessage | A pointer to a message buffer. |
OTAPI void OTCALL otMessageGetBufferInfo | ( | otInstance * | aInstance, |
otBufferInfo * | aBufferInfo | ||
) |
Get the Message Buffer information.
[in] | aInstance | A pointer to the OpenThread instance. |
[out] | aBufferInfo | A pointer where the message buffer information is written. |
uint16_t otMessageGetLength | ( | otMessage * | aMessage | ) |
Get the message length in bytes.
[in] | aMessage | A pointer to a message buffer. |
uint16_t otMessageGetOffset | ( | otMessage * | aMessage | ) |
Get the message offset in bytes.
[in] | aMessage | A pointer to a message buffer. |
int8_t otMessageGetRss | ( | otMessage * | aMessage | ) |
This function returns the average RSS (received signal strength) associated with the message.
bool otMessageIsLinkSecurityEnabled | ( | otMessage * | aMessage | ) |
This function indicates whether or not link security is enabled for the message.
[in] | aMessage | A pointer to a message buffer. |
TRUE | If link security is enabled. |
FALSE | If link security is not enabled. |
otError otMessageQueueDequeue | ( | otMessageQueue * | aQueue, |
otMessage * | aMessage | ||
) |
This function removes a message from the given message queue.
[in] | aQueue | A pointer to the message queue. |
[in] | aMessage | The message to remove. |
OT_ERROR_NONE | Successfully removed the message from the queue. |
OT_ERROR_NOT_FOUND | The message is not enqueued in this queue. |
otError otMessageQueueEnqueue | ( | otMessageQueue * | aQueue, |
otMessage * | aMessage | ||
) |
This function adds a message to the end of the given message queue.
[in] | aQueue | A pointer to the message queue. |
[in] | aMessage | The message to add. |
OT_ERROR_NONE | Successfully added the message to the queue. |
OT_ERROR_ALREADY | The message is already enqueued in a queue. |
otError otMessageQueueEnqueueAtHead | ( | otMessageQueue * | aQueue, |
otMessage * | aMessage | ||
) |
This function adds a message at the head/front of the given message queue.
[in] | aQueue | A pointer to the message queue. |
[in] | aMessage | The message to add. |
OT_ERROR_NONE | Successfully added the message to the queue. |
OT_ERROR_ALREADY | The message is already enqueued in a queue. |
otMessage* otMessageQueueGetHead | ( | otMessageQueue * | aQueue | ) |
This function returns a pointer to the message at the head of the queue.
[in] | aQueue | A pointer to a message queue. |
otMessage* otMessageQueueGetNext | ( | otMessageQueue * | aQueue, |
const otMessage * | aMessage | ||
) |
This function returns a pointer to the next message in the queue by iterating forward (from head to tail).
[in] | aQueue | A pointer to a message queue. |
[in] | aMessage | A pointer to current message buffer. |
aMessage
or NULL if aMessage is the tail of queue. NULL is returned if
aMessageis not in the queue
aQueue`. void otMessageQueueInit | ( | otMessageQueue * | aQueue | ) |
Initialize the message queue.
This function MUST be called once and only once for a otMessageQueue
instance before any other otMessageQueue
functions. The behavior is undefined if other queue APIs are used with an otMessageQueue
before it being initialized or if it is initialized more than once.
[in] | aQueue | A pointer to a message queue. |
int otMessageRead | ( | otMessage * | aMessage, |
uint16_t | aOffset, | ||
void * | aBuf, | ||
uint16_t | aLength | ||
) |
Read bytes from a message.
[in] | aMessage | A pointer to a message buffer. |
[in] | aOffset | An offset in bytes. |
[in] | aBuf | A pointer to a buffer that message bytes are read to. |
[in] | aLength | Number of bytes to read. |
void otMessageSetDirectTransmission | ( | otMessage * | aMessage, |
bool | aEnabled | ||
) |
This function sets/forces the message to be forwarded using direct transmission.
Default setting for a new message is false
.
[in] | aMessage | A pointer to a message buffer. |
[in] | aEnabled | If true , the message is forced to use direct transmission. If false , the message follows the normal procedure. |
Set the message length in bytes.
[in] | aMessage | A pointer to a message buffer. |
[in] | aLength | A length in bytes. |
OT_ERROR_NONE | Successfully set the message length. |
OT_ERROR_NO_BUFS | No available buffers to grow the message. |
Set the message offset in bytes.
[in] | aMessage | A pointer to a message buffer. |
[in] | aOffset | An offset in bytes. |
OT_ERROR_NONE | Successfully set the message offset. |
OT_ERROR_INVALID_ARGS | The offset is beyond the message length. |
int otMessageWrite | ( | otMessage * | aMessage, |
uint16_t | aOffset, | ||
const void * | aBuf, | ||
uint16_t | aLength | ||
) |
Write bytes to a message.
[in] | aMessage | A pointer to a message buffer. |
[in] | aOffset | An offset in bytes. |
[in] | aBuf | A pointer to a buffer that message bytes are written from. |
[in] | aLength | Number of bytes to write. |