Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 1 | #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 Lee | c3ea8a7 | 2015-06-16 15:28:21 +0900 | [diff] [blame] | 13 | #include "wilc_platform.h" |
| 14 | #include "wilc_errorsupport.h" |
| 15 | #include "wilc_memory.h" |
Dean Lee | c3ea8a7 | 2015-06-16 15:28:21 +0900 | [diff] [blame] | 16 | |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 17 | /*! |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 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 |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 26 | * @author syounan |
| 27 | * @date 30 Aug 2010 |
| 28 | * @version 1.0 |
| 29 | */ |
Greg Kroah-Hartman | c4f83a5 | 2015-08-17 11:32:38 -0700 | [diff] [blame] | 30 | WILC_ErrNo WILC_MsgQueueCreate(WILC_MsgQueueHandle *pHandle); |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 31 | |
| 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 Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 43 | * @author syounan |
| 44 | * @date 30 Aug 2010 |
| 45 | * @version 1.0 |
| 46 | */ |
| 47 | WILC_ErrNo WILC_MsgQueueSend(WILC_MsgQueueHandle *pHandle, |
Greg Kroah-Hartman | c4f83a5 | 2015-08-17 11:32:38 -0700 | [diff] [blame] | 48 | const void *pvSendBuffer, u32 u32SendBufferSize); |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 49 | |
| 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 Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 62 | * @author syounan |
| 63 | * @date 30 Aug 2010 |
| 64 | * @version 1.0 |
| 65 | */ |
| 66 | WILC_ErrNo WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle, |
Chaehyun Lim | 4e4467f | 2015-06-11 14:35:55 +0900 | [diff] [blame] | 67 | void *pvRecvBuffer, u32 u32RecvBufferSize, |
Greg Kroah-Hartman | c4f83a5 | 2015-08-17 11:32:38 -0700 | [diff] [blame] | 68 | u32 *pu32ReceivedLength); |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 69 | |
| 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 Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 75 | * @author syounan |
| 76 | * @date 30 Aug 2010 |
| 77 | * @version 1.0 |
| 78 | */ |
Greg Kroah-Hartman | c4f83a5 | 2015-08-17 11:32:38 -0700 | [diff] [blame] | 79 | WILC_ErrNo WILC_MsgQueueDestroy(WILC_MsgQueueHandle *pHandle); |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 80 | |
| 81 | #endif |