MCUXpresso SDK API Reference Manual  Rev 2.12.1
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Messaging

Overview

Enumerations

enum  messaging_status_t {
  kMSG_Success = kStatus_Success,
  kMSG_Error = MAKE_STATUS(kStatusGroup_MSG, 1)
}
 The msg status. More...
 

Functions

void * MSG_Alloc (uint32_t length)
 Allocates a message node with the length. More...
 
void MSG_Free (void *buffer)
 frees a buffer allocated by MSG_Alloc. More...
 
messaging_status_t MSG_QueueAddTail (messaging_t *msgQueue, void *msg)
 Links a message to the tail of the message queue. More...
 
messaging_status_t MSG_QueueAddHead (messaging_t *msgQueue, void *msg)
 Links a message to the head of the message queue. More...
 
messaging_status_t MSG_QueueAddPrev (void *msg, void *newMsg)
 Links a message to the previous of the given message. More...
 
messaging_status_t MSG_QueueRemove (void *msg)
 Unlinks a message from its message queue. More...
 
void * MSG_QueueRemoveHead (messaging_t *msgQueue)
 Unlinks the head from the message queue. More...
 
void * MSG_QueueGetHead (messaging_t *msgQueue)
 Gets the head of the message queue. More...
 
void * MSG_QueueGetNext (void *msg)
 Gets the next node of a given message. More...
 
void * MSG_QueueGetPrev (void *msg)
 Gets the previous node of a given message. More...
 

Enumeration Type Documentation

Enumerator
kMSG_Success 

Success.

kMSG_Error 

Error.

Function Documentation

void* MSG_Alloc ( uint32_t  length)

This function allocates a message node with the length.

Parameters
lengthThe length of the message.
Return values
Theallocated memory buffer address.
void MSG_Free ( void *  buffer)

This function frees a buffer allocated by MSG_Alloc.

Parameters
bufferThe buffer address.
messaging_status_t MSG_QueueAddTail ( messaging_t msgQueue,
void *  msg 
)

The function links a message to the tail of the message queue. The memory space of the message must be allocated by calling the function MSG_Alloc. And the memory space of the message must be freed by calling the function MSG_Free.

Parameters
msgQueueThe message queue pointer.
msgThe pointer of the message allocated by the MSG_Alloc.
Return values
kMSG_SuccessThe message is added.
kMSG_ErrorThe message addition failed.
messaging_status_t MSG_QueueAddHead ( messaging_t msgQueue,
void *  msg 
)

The function links a message to the head of the message queue. The memory space of the message must be allocated by calling the function MSG_Alloc. And the memory space of the message must be freed by calling the function MSG_Free.

Parameters
msgQueueThe message queue pointer.
msgThe pointer of the message allocated by the MSG_Alloc.
Return values
kMSG_SuccessThe message is added.
kMSG_ErrorThe message addition failed.
messaging_status_t MSG_QueueAddPrev ( void *  msg,
void *  newMsg 
)

The function links a message to the previous of the given message. The memory space of the message must be allocated by calling the function MSG_Alloc. And the memory space of the message must be freed by calling the function MSG_Free.

Parameters
msgThe given message pointer.
newMsgA new message pointer needs to be added.
Return values
kMSG_SuccessThe message is added.
kMSG_ErrorThe message addition failed.
messaging_status_t MSG_QueueRemove ( void *  msg)

The function unlinks a message from its message queue. The memory space of the message must be allocated by calling the function MSG_Alloc. And the memory space of the message must be freed by calling the function MSG_Free.

Parameters
msgThe message pointer.
Return values
kMSG_SuccessThe message is removed.
kMSG_ErrorThe message removal failed.
void* MSG_QueueRemoveHead ( messaging_t msgQueue)

The function unlinks the head from the message queue.

Parameters
msgQueueThe message queue pointer.
Return values
NULLif the message queue is empty, or the pointer of removed message if removal was successful.
void* MSG_QueueGetHead ( messaging_t msgQueue)

The function gets the head of the message queue.

Parameters
msgQueueThe message queue pointer.
Return values
Thepointer of the message if the head is not NULL, or NULL.
void* MSG_QueueGetNext ( void *  msg)

The function gets the next node of a given message. The memory space of the message must be allocated by calling the function MSG_Alloc. And the memory space of the message must be freed by calling the function MSG_Free.

Parameters
msgThe message pointer.
Return values
Thepointer of the message if the next pointer is not NULL, or NULL.
void* MSG_QueueGetPrev ( void *  msg)

The function gets the previous node of a given message. The memory space of the message must be allocated by calling the function MSG_Alloc. And the memory space of the message must be freed by calling the function MSG_Free.

Parameters
msgThe message pointer.
Return values
Thepointer of the message if the previous pointer is not NULL, or NULL.