Caching the advertising data and the scan response.
Fork of MaximBLE by
exactLE/wsf/include/wsf_msg.h@0:b562096246b3, 2016-03-03 (annotated)
- Committer:
- enginerd
- Date:
- Thu Mar 03 14:13:21 2016 +0000
- Revision:
- 0:b562096246b3
Initial commit of Maxim Integrated Bluetooth LE Library
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
enginerd | 0:b562096246b3 | 1 | /*************************************************************************************************/ |
enginerd | 0:b562096246b3 | 2 | /*! |
enginerd | 0:b562096246b3 | 3 | * \file wsf_msg.h |
enginerd | 0:b562096246b3 | 4 | * |
enginerd | 0:b562096246b3 | 5 | * \brief Message passing service. |
enginerd | 0:b562096246b3 | 6 | * |
enginerd | 0:b562096246b3 | 7 | * $Date: 2013-07-02 15:08:09 -0700 (Tue, 02 Jul 2013) $ |
enginerd | 0:b562096246b3 | 8 | * $Revision: 779 $ |
enginerd | 0:b562096246b3 | 9 | * |
enginerd | 0:b562096246b3 | 10 | * Copyright (c) 2009-2016 ARM Limited. All rights reserved. |
enginerd | 0:b562096246b3 | 11 | * |
enginerd | 0:b562096246b3 | 12 | * SPDX-License-Identifier: LicenseRef-PBL |
enginerd | 0:b562096246b3 | 13 | * |
enginerd | 0:b562096246b3 | 14 | * Licensed under the Permissive Binary License, Version 1.0 (the "License"); you may not use |
enginerd | 0:b562096246b3 | 15 | * this file except in compliance with the License. You may obtain a copy of the License at |
enginerd | 0:b562096246b3 | 16 | * |
enginerd | 0:b562096246b3 | 17 | * https://www.mbed.com/licenses/PBL-1.0 |
enginerd | 0:b562096246b3 | 18 | * |
enginerd | 0:b562096246b3 | 19 | * See the License for the specific language governing permissions and limitations under the License. |
enginerd | 0:b562096246b3 | 20 | */ |
enginerd | 0:b562096246b3 | 21 | /*************************************************************************************************/ |
enginerd | 0:b562096246b3 | 22 | #ifndef WSF_MSG_H |
enginerd | 0:b562096246b3 | 23 | #define WSF_MSG_H |
enginerd | 0:b562096246b3 | 24 | |
enginerd | 0:b562096246b3 | 25 | #include "wsf_queue.h" |
enginerd | 0:b562096246b3 | 26 | #include "wsf_os.h" |
enginerd | 0:b562096246b3 | 27 | |
enginerd | 0:b562096246b3 | 28 | #ifdef __cplusplus |
enginerd | 0:b562096246b3 | 29 | extern "C" { |
enginerd | 0:b562096246b3 | 30 | #endif |
enginerd | 0:b562096246b3 | 31 | |
enginerd | 0:b562096246b3 | 32 | /************************************************************************************************** |
enginerd | 0:b562096246b3 | 33 | Function Declarations |
enginerd | 0:b562096246b3 | 34 | **************************************************************************************************/ |
enginerd | 0:b562096246b3 | 35 | |
enginerd | 0:b562096246b3 | 36 | /*************************************************************************************************/ |
enginerd | 0:b562096246b3 | 37 | /*! |
enginerd | 0:b562096246b3 | 38 | * \fn WsfMsgAlloc |
enginerd | 0:b562096246b3 | 39 | * |
enginerd | 0:b562096246b3 | 40 | * \brief Allocate a message buffer to be sent with WsfMsgSend(). |
enginerd | 0:b562096246b3 | 41 | * |
enginerd | 0:b562096246b3 | 42 | * \param len Message length in bytes. |
enginerd | 0:b562096246b3 | 43 | * |
enginerd | 0:b562096246b3 | 44 | * \return Pointer to message buffer or NULL if allocation failed. |
enginerd | 0:b562096246b3 | 45 | */ |
enginerd | 0:b562096246b3 | 46 | /*************************************************************************************************/ |
enginerd | 0:b562096246b3 | 47 | void *WsfMsgAlloc(uint16_t len); |
enginerd | 0:b562096246b3 | 48 | |
enginerd | 0:b562096246b3 | 49 | /*************************************************************************************************/ |
enginerd | 0:b562096246b3 | 50 | /*! |
enginerd | 0:b562096246b3 | 51 | * \fn WsfMsgFree |
enginerd | 0:b562096246b3 | 52 | * |
enginerd | 0:b562096246b3 | 53 | * \brief Free a message buffer allocated with WsfMsgAlloc(). |
enginerd | 0:b562096246b3 | 54 | * |
enginerd | 0:b562096246b3 | 55 | * \param pMsg Pointer to message buffer. |
enginerd | 0:b562096246b3 | 56 | * |
enginerd | 0:b562096246b3 | 57 | * \return None. |
enginerd | 0:b562096246b3 | 58 | */ |
enginerd | 0:b562096246b3 | 59 | /*************************************************************************************************/ |
enginerd | 0:b562096246b3 | 60 | void WsfMsgFree(void *pMsg); |
enginerd | 0:b562096246b3 | 61 | |
enginerd | 0:b562096246b3 | 62 | /*************************************************************************************************/ |
enginerd | 0:b562096246b3 | 63 | /*! |
enginerd | 0:b562096246b3 | 64 | * \fn WsfMsgSend |
enginerd | 0:b562096246b3 | 65 | * |
enginerd | 0:b562096246b3 | 66 | * \brief Send a message to an event handler. |
enginerd | 0:b562096246b3 | 67 | * |
enginerd | 0:b562096246b3 | 68 | * \param handlerId Event handler ID. |
enginerd | 0:b562096246b3 | 69 | * \param pMsg Pointer to message buffer. |
enginerd | 0:b562096246b3 | 70 | * |
enginerd | 0:b562096246b3 | 71 | * \return None. |
enginerd | 0:b562096246b3 | 72 | */ |
enginerd | 0:b562096246b3 | 73 | /*************************************************************************************************/ |
enginerd | 0:b562096246b3 | 74 | void WsfMsgSend(wsfHandlerId_t handlerId, void *pMsg); |
enginerd | 0:b562096246b3 | 75 | |
enginerd | 0:b562096246b3 | 76 | /*************************************************************************************************/ |
enginerd | 0:b562096246b3 | 77 | /*! |
enginerd | 0:b562096246b3 | 78 | * \fn WsfMsgEnq |
enginerd | 0:b562096246b3 | 79 | * |
enginerd | 0:b562096246b3 | 80 | * \brief Enqueue a message. |
enginerd | 0:b562096246b3 | 81 | * |
enginerd | 0:b562096246b3 | 82 | * \param pQueue Pointer to queue. |
enginerd | 0:b562096246b3 | 83 | * \param handerId Set message handler ID to this value. |
enginerd | 0:b562096246b3 | 84 | * \param pElem Pointer to message buffer. |
enginerd | 0:b562096246b3 | 85 | * |
enginerd | 0:b562096246b3 | 86 | * \return None. |
enginerd | 0:b562096246b3 | 87 | */ |
enginerd | 0:b562096246b3 | 88 | /*************************************************************************************************/ |
enginerd | 0:b562096246b3 | 89 | void WsfMsgEnq(wsfQueue_t *pQueue, wsfHandlerId_t handlerId, void *pMsg); |
enginerd | 0:b562096246b3 | 90 | |
enginerd | 0:b562096246b3 | 91 | /*************************************************************************************************/ |
enginerd | 0:b562096246b3 | 92 | /*! |
enginerd | 0:b562096246b3 | 93 | * \fn WsfMsgDeq |
enginerd | 0:b562096246b3 | 94 | * |
enginerd | 0:b562096246b3 | 95 | * \brief Dequeue a message. |
enginerd | 0:b562096246b3 | 96 | * |
enginerd | 0:b562096246b3 | 97 | * \param pQueue Pointer to queue. |
enginerd | 0:b562096246b3 | 98 | * \param pHandlerId Handler ID of returned message; this is a return parameter. |
enginerd | 0:b562096246b3 | 99 | * |
enginerd | 0:b562096246b3 | 100 | * \return Pointer to message that has been dequeued or NULL if queue is empty. |
enginerd | 0:b562096246b3 | 101 | */ |
enginerd | 0:b562096246b3 | 102 | /*************************************************************************************************/ |
enginerd | 0:b562096246b3 | 103 | void *WsfMsgDeq(wsfQueue_t *pQueue, wsfHandlerId_t *pHandlerId); |
enginerd | 0:b562096246b3 | 104 | |
enginerd | 0:b562096246b3 | 105 | /*************************************************************************************************/ |
enginerd | 0:b562096246b3 | 106 | /*! |
enginerd | 0:b562096246b3 | 107 | * \fn WsfMsgPeek |
enginerd | 0:b562096246b3 | 108 | * |
enginerd | 0:b562096246b3 | 109 | * \brief Get the next message without removing it from the queue. |
enginerd | 0:b562096246b3 | 110 | * |
enginerd | 0:b562096246b3 | 111 | * \param pQueue Pointer to queue. |
enginerd | 0:b562096246b3 | 112 | * \param pHandlerId Handler ID of returned message; this is a return parameter. |
enginerd | 0:b562096246b3 | 113 | * |
enginerd | 0:b562096246b3 | 114 | * \return Pointer to the next message on the queue or NULL if queue is empty. |
enginerd | 0:b562096246b3 | 115 | */ |
enginerd | 0:b562096246b3 | 116 | /*************************************************************************************************/ |
enginerd | 0:b562096246b3 | 117 | void *WsfMsgPeek(wsfQueue_t *pQueue, wsfHandlerId_t *pHandlerId); |
enginerd | 0:b562096246b3 | 118 | |
enginerd | 0:b562096246b3 | 119 | #ifdef __cplusplus |
enginerd | 0:b562096246b3 | 120 | }; |
enginerd | 0:b562096246b3 | 121 | #endif |
enginerd | 0:b562096246b3 | 122 | |
enginerd | 0:b562096246b3 | 123 | #endif /* WSF_MSG_H */ |