Message
This module includes functions that manipulate OpenThread message buffers.
Summary
Enumerations |
|
---|---|
otMessagePriority{
|
enum This enumeration defines the OpenThread message priority levels. |
Typedefs |
|
---|---|
otBufferInfo
|
typedefstruct otBufferInfo
This structure represents the message buffer information for different queues used by OpenThread stack. |
otMessage
|
typedefstruct otMessage
This type is an opaque representation of an OpenThread message buffer. |
otMessagePriority
|
typedefenum otMessagePriority
This enumeration defines the OpenThread message priority levels. |
otMessageQueueInfo
|
typedefstruct otMessageQueueInfo
This structure represents information about a message queue. |
otMessageSettings
|
typedefstruct otMessageSettings
This structure represents a message settings. |
Functions |
|
---|---|
otMessageAppend(otMessage *aMessage, const void *aBuf, uint16_t aLength)
|
Append bytes to a message.
|
otMessageFree(otMessage *aMessage)
|
void
Free an allocated message buffer.
|
otMessageGetBufferInfo(otInstance *aInstance, otBufferInfo *aBufferInfo)
|
void
Get the Message Buffer information.
|
otMessageGetLength(const otMessage *aMessage)
|
uint16_t
Get the message length in bytes.
|
otMessageGetOffset(const otMessage *aMessage)
|
uint16_t
Get the message offset in bytes.
|
otMessageGetRss(const otMessage *aMessage)
|
int8_t
This function returns the average RSS (received signal strength) associated with the message.
|
otMessageIsLinkSecurityEnabled(const otMessage *aMessage)
|
bool
This function indicates whether or not link security is enabled for the message.
|
otMessageQueueDequeue(otMessageQueue *aQueue, otMessage *aMessage)
|
void
This function removes a message from the given message queue.
|
otMessageQueueEnqueue(otMessageQueue *aQueue, otMessage *aMessage)
|
void
This function adds a message to the end of the given message queue.
|
otMessageQueueEnqueueAtHead(otMessageQueue *aQueue, otMessage *aMessage)
|
void
This function adds a message at the head/front of the given message queue.
|
otMessageQueueGetHead(otMessageQueue *aQueue)
|
This function returns a pointer to the message at the head of the queue.
|
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).
|
otMessageQueueInit(otMessageQueue *aQueue)
|
void
Initialize the message queue.
|
otMessageRead(const otMessage *aMessage, uint16_t aOffset, void *aBuf, uint16_t aLength)
|
uint16_t
Read bytes from a message.
|
otMessageSetDirectTransmission(otMessage *aMessage, bool aEnabled)
|
void
This function sets/forces the message to be forwarded using direct transmission.
|
otMessageSetLength(otMessage *aMessage, uint16_t aLength)
|
Set the message length in bytes.
|
otMessageSetOffset(otMessage *aMessage, uint16_t aOffset)
|
void
Set the message offset in bytes.
|
otMessageWrite(otMessage *aMessage, uint16_t aOffset, const void *aBuf, uint16_t aLength)
|
int
Write bytes to a message.
|
Structs |
|
---|---|
otBufferInfo |
This structure represents the message buffer information for different queues used by OpenThread stack. |
otMessageQueue |
This structure represents an OpenThread message queue. |
otMessageQueueInfo |
This structure represents information about a message queue. |
otMessageSettings |
This structure represents a message settings. |
Enumerations
otMessagePriority
otMessagePriority
This enumeration defines the OpenThread message priority levels.
Properties | |
---|---|
OT_MESSAGE_PRIORITY_HIGH
|
High priority level. |
OT_MESSAGE_PRIORITY_LOW
|
Low priority level. |
OT_MESSAGE_PRIORITY_NORMAL
|
Normal priority level. |
Typedefs
otBufferInfo
struct otBufferInfo otBufferInfo
This structure represents the message buffer information for different queues used by OpenThread stack.
otMessage
struct otMessage otMessage
This type is an opaque representation of an OpenThread message buffer.
otMessagePriority
enum otMessagePriority otMessagePriority
This enumeration defines the OpenThread message priority levels.
otMessageQueueInfo
struct otMessageQueueInfo otMessageQueueInfo
This structure represents information about a message queue.
otMessageSettings
struct otMessageSettings otMessageSettings
This structure represents a message settings.
Functions
otMessageAppend
otError otMessageAppend( otMessage *aMessage, const void *aBuf, uint16_t aLength )
Append bytes to a message.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otMessageFree
otMessageGetLength
otMessageSetLength
otMessageGetOffset
otMessageSetOffset
otMessageRead
otMessageWrite
otMessageFree
void otMessageFree( otMessage *aMessage )
Free an allocated message buffer.
Details | |||
---|---|---|---|
Parameters |
|
otMessageAppend
otMessageGetLength
otMessageSetLength
otMessageGetOffset
otMessageSetOffset
otMessageRead
otMessageWrite
otMessageGetBufferInfo
void otMessageGetBufferInfo( otInstance *aInstance, otBufferInfo *aBufferInfo )
Get the Message Buffer information.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otMessageGetLength
uint16_t otMessageGetLength( const otMessage *aMessage )
Get the message length in bytes.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The message length in bytes.
|
otMessageFree
otMessageAppend
otMessageSetLength
otMessageGetOffset
otMessageSetOffset
otMessageRead
otMessageWrite
otMessageSetLength
otMessageGetOffset
uint16_t otMessageGetOffset( const otMessage *aMessage )
Get the message offset in bytes.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The message offset value.
|
otMessageFree
otMessageAppend
otMessageGetLength
otMessageSetLength
otMessageSetOffset
otMessageRead
otMessageWrite
otMessageGetRss
int8_t otMessageGetRss( const otMessage *aMessage )
This function returns the average RSS (received signal strength) associated with the message.
Details | |
---|---|
Returns |
The average RSS value (in dBm) or OT_RADIO_RSSI_INVALID if no average RSS is available.
|
otMessageIsLinkSecurityEnabled
bool otMessageIsLinkSecurityEnabled( const otMessage *aMessage )
This function indicates whether or not link security is enabled for the message.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otMessageQueueDequeue
void otMessageQueueDequeue( otMessageQueue *aQueue, otMessage *aMessage )
This function removes a message from the given message queue.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otMessageQueueEnqueue
void otMessageQueueEnqueue( otMessageQueue *aQueue, otMessage *aMessage )
This function adds a message to the end of the given message queue.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otMessageQueueEnqueueAtHead
void otMessageQueueEnqueueAtHead( otMessageQueue *aQueue, otMessage *aMessage )
This function adds a message at the head/front of the given message queue.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otMessageQueueGetHead
otMessage * otMessageQueueGetHead( otMessageQueue *aQueue )
This function returns a pointer to the message at the head of the queue.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
A pointer to the message at the head of queue or NULL if queue is empty.
|
otMessageQueueGetNext
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).
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
A pointer to the next message in the queue after
aMessage or NULL if aMessage is the tail of queue. NULL is returned if aMessageis not in the queue aQueue`. |
otMessageQueueInit
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.
Details | |||
---|---|---|---|
Parameters |
|
otMessageRead
uint16_t otMessageRead( const otMessage *aMessage, uint16_t aOffset, void *aBuf, uint16_t aLength )
Read bytes from a message.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Returns |
The number of bytes read.
|
otMessageFree
otMessageAppend
otMessageGetLength
otMessageSetLength
otMessageGetOffset
otMessageSetOffset
otMessageWrite
otMessageSetDirectTransmission
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
.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otMessageSetLength
otError otMessageSetLength( otMessage *aMessage, uint16_t aLength )
Set the message length in bytes.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otMessageFree
otMessageAppend
otMessageGetLength
otMessageGetOffset
otMessageSetOffset
otMessageRead
otMessageWrite
otMessageSetOffset
void otMessageSetOffset( otMessage *aMessage, uint16_t aOffset )
Set the message offset in bytes.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otMessageFree
otMessageAppend
otMessageGetLength
otMessageSetLength
otMessageGetOffset
otMessageRead
otMessageWrite
otMessageWrite
int otMessageWrite( otMessage *aMessage, uint16_t aOffset, const void *aBuf, uint16_t aLength )
Write bytes to a message.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Returns |
The number of bytes written.
|
otMessageFree
otMessageAppend
otMessageGetLength
otMessageSetLength
otMessageGetOffset
otMessageSetOffset
otMessageRead
Resources
OpenThread API Reference topics originate from the source code, available on GitHub. For more information, or to contribute to our documentation, refer to Resources.