1 #ifndef __WILC_MSG_QUEUE_H__
2 #define __WILC_MSG_QUEUE_H__
5 * @file wilc_msgqueue.h
6 * @brief Message Queue OS wrapper functionality
8 * @sa wilc_oswrapper.h top level OS wrapper file
13 #include "wilc_platform.h"
14 #include "wilc_errorsupport.h"
15 #include "wilc_memory.h"
18 * @brief Creates a new Message queue
19 * @details Creates a new Message queue, if the feature
20 * CONFIG_WILC_MSG_QUEUE_IPC_NAME is enabled and pstrAttrs->pcName
21 * is not Null, then this message queue can be used for IPC with
22 * any other message queue having the same name in the system
23 * @param[in,out] pHandle handle to the message queue object
24 * @param[in] pstrAttrs Optional attributes, NULL for default
25 * @return Error code indicating sucess/failure
30 WILC_ErrNo WILC_MsgQueueCreate(WILC_MsgQueueHandle *pHandle);
33 * @brief Sends a message
34 * @details Sends a message, this API will block unil the message is
35 * actually sent or until it is timedout (as long as the feature
36 * CONFIG_WILC_MSG_QUEUE_TIMEOUT is enabled and pstrAttrs->u32Timeout
37 * is not set to WILC_OS_INFINITY), zero timeout is a valid value
38 * @param[in] pHandle handle to the message queue object
39 * @param[in] pvSendBuffer pointer to the data to send
40 * @param[in] u32SendBufferSize the size of the data to send
41 * @param[in] pstrAttrs Optional attributes, NULL for default
42 * @return Error code indicating sucess/failure
47 WILC_ErrNo WILC_MsgQueueSend(WILC_MsgQueueHandle *pHandle,
48 const void *pvSendBuffer, u32 u32SendBufferSize);
51 * @brief Receives a message
52 * @details Receives a message, this API will block unil a message is
53 * received or until it is timedout (as long as the feature
54 * CONFIG_WILC_MSG_QUEUE_TIMEOUT is enabled and pstrAttrs->u32Timeout
55 * is not set to WILC_OS_INFINITY), zero timeout is a valid value
56 * @param[in] pHandle handle to the message queue object
57 * @param[out] pvRecvBuffer pointer to a buffer to fill with the received message
58 * @param[in] u32RecvBufferSize the size of the receive buffer
59 * @param[out] pu32ReceivedLength the length of received data
60 * @param[in] pstrAttrs Optional attributes, NULL for default
61 * @return Error code indicating sucess/failure
66 WILC_ErrNo WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle,
67 void *pvRecvBuffer, u32 u32RecvBufferSize,
68 u32 *pu32ReceivedLength);
71 * @brief Destroys an existing Message queue
72 * @param[in] pHandle handle to the message queue object
73 * @param[in] pstrAttrs Optional attributes, NULL for default
74 * @return Error code indicating sucess/failure
79 WILC_ErrNo WILC_MsgQueueDestroy(WILC_MsgQueueHandle *pHandle);