blob: ef1d2fa20c50a835f4a8c61ecbea1906d68b52b5 [file] [log] [blame]
Johnny Kimc5c77ba2015-05-11 14:30:56 +09001#ifndef __WILC_MSG_QUEUE_H__
2#define __WILC_MSG_QUEUE_H__
3
4/*!
5 * @file wilc_msgqueue.h
6 * @brief Message Queue OS wrapper functionality
7 * @author syounan
8 * @sa wilc_oswrapper.h top level OS wrapper file
9 * @date 30 Aug 2010
10 * @version 1.0
11 */
12
Dean Leec3ea8a72015-06-16 15:28:21 +090013#include "wilc_platform.h"
14#include "wilc_errorsupport.h"
15#include "wilc_memory.h"
Dean Leec3ea8a72015-06-16 15:28:21 +090016
Johnny Kimc5c77ba2015-05-11 14:30:56 +090017/*!
Johnny Kimc5c77ba2015-05-11 14:30:56 +090018 * @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
Johnny Kimc5c77ba2015-05-11 14:30:56 +090026 * @author syounan
27 * @date 30 Aug 2010
28 * @version 1.0
29 */
Greg Kroah-Hartmanc4f83a52015-08-17 11:32:38 -070030WILC_ErrNo WILC_MsgQueueCreate(WILC_MsgQueueHandle *pHandle);
Johnny Kimc5c77ba2015-05-11 14:30:56 +090031
32/*!
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
Johnny Kimc5c77ba2015-05-11 14:30:56 +090043 * @author syounan
44 * @date 30 Aug 2010
45 * @version 1.0
46 */
47WILC_ErrNo WILC_MsgQueueSend(WILC_MsgQueueHandle *pHandle,
Greg Kroah-Hartmanc4f83a52015-08-17 11:32:38 -070048 const void *pvSendBuffer, u32 u32SendBufferSize);
Johnny Kimc5c77ba2015-05-11 14:30:56 +090049
50/*!
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
Johnny Kimc5c77ba2015-05-11 14:30:56 +090062 * @author syounan
63 * @date 30 Aug 2010
64 * @version 1.0
65 */
66WILC_ErrNo WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle,
Chaehyun Lim4e4467f2015-06-11 14:35:55 +090067 void *pvRecvBuffer, u32 u32RecvBufferSize,
Greg Kroah-Hartmanc4f83a52015-08-17 11:32:38 -070068 u32 *pu32ReceivedLength);
Johnny Kimc5c77ba2015-05-11 14:30:56 +090069
70/*!
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
Johnny Kimc5c77ba2015-05-11 14:30:56 +090075 * @author syounan
76 * @date 30 Aug 2010
77 * @version 1.0
78 */
Greg Kroah-Hartmanc4f83a52015-08-17 11:32:38 -070079WILC_ErrNo WILC_MsgQueueDestroy(WILC_MsgQueueHandle *pHandle);
Johnny Kimc5c77ba2015-05-11 14:30:56 +090080
81#endif