Caching the advertising data and the scan response.

Fork of MaximBLE by Maxim Integrated

Committer:
kgills
Date:
Tue Mar 22 18:16:10 2016 +0000
Revision:
1:4e764337d5c5
Parent:
0:b562096246b3
Caching the advertising data and scan response.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
enginerd 0:b562096246b3 1 /*************************************************************************************************/
enginerd 0:b562096246b3 2 /*!
enginerd 0:b562096246b3 3 * \file wsf_os.h
enginerd 0:b562096246b3 4 *
enginerd 0:b562096246b3 5 * \brief Software foundation OS API.
enginerd 0:b562096246b3 6 *
enginerd 0:b562096246b3 7 * $Date: 2012-10-22 14:09:36 -0700 (Mon, 22 Oct 2012) $
enginerd 0:b562096246b3 8 * $Revision: 359 $
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_OS_H
enginerd 0:b562096246b3 23 #define WSF_OS_H
enginerd 0:b562096246b3 24
enginerd 0:b562096246b3 25 #include "wsf_os_int.h"
enginerd 0:b562096246b3 26 #include "wsf_queue.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 Data Types
enginerd 0:b562096246b3 34 **************************************************************************************************/
enginerd 0:b562096246b3 35
enginerd 0:b562096246b3 36 /*! Common message structure passed to event handler */
enginerd 0:b562096246b3 37 typedef struct
enginerd 0:b562096246b3 38 {
enginerd 0:b562096246b3 39 uint16_t param; /*! General purpose parameter passed to event handler */
enginerd 0:b562096246b3 40 uint8_t event; /*! General purpose event value passed to event handler */
enginerd 0:b562096246b3 41 uint8_t status; /*! General purpose status value passed to event handler */
enginerd 0:b562096246b3 42 } wsfMsgHdr_t;
enginerd 0:b562096246b3 43
enginerd 0:b562096246b3 44 /**************************************************************************************************
enginerd 0:b562096246b3 45 Callback Function Types
enginerd 0:b562096246b3 46 **************************************************************************************************/
enginerd 0:b562096246b3 47
enginerd 0:b562096246b3 48 /*************************************************************************************************/
enginerd 0:b562096246b3 49 /*!
enginerd 0:b562096246b3 50 * \fn wsfEventHandler_t
enginerd 0:b562096246b3 51 *
enginerd 0:b562096246b3 52 * \brief Event handler callback function.
enginerd 0:b562096246b3 53 *
enginerd 0:b562096246b3 54 * \param event Mask of events set for the event handler.
enginerd 0:b562096246b3 55 * \param pMsg Pointer to message for the event handler.
enginerd 0:b562096246b3 56 *
enginerd 0:b562096246b3 57 * \return None.
enginerd 0:b562096246b3 58 */
enginerd 0:b562096246b3 59 /*************************************************************************************************/
enginerd 0:b562096246b3 60 typedef void (*wsfEventHandler_t)(wsfEventMask_t event, wsfMsgHdr_t *pMsg);
enginerd 0:b562096246b3 61
enginerd 0:b562096246b3 62 /**************************************************************************************************
enginerd 0:b562096246b3 63 Function Declarations
enginerd 0:b562096246b3 64 **************************************************************************************************/
enginerd 0:b562096246b3 65
enginerd 0:b562096246b3 66 /*************************************************************************************************/
enginerd 0:b562096246b3 67 /*!
enginerd 0:b562096246b3 68 * \fn WsfSetEvent
enginerd 0:b562096246b3 69 *
enginerd 0:b562096246b3 70 * \brief Set an event for an event handler.
enginerd 0:b562096246b3 71 *
enginerd 0:b562096246b3 72 * \param handlerId Handler ID.
enginerd 0:b562096246b3 73 * \param event Event or events to set.
enginerd 0:b562096246b3 74 *
enginerd 0:b562096246b3 75 * \return None.
enginerd 0:b562096246b3 76 */
enginerd 0:b562096246b3 77 /*************************************************************************************************/
enginerd 0:b562096246b3 78 void WsfSetEvent(wsfHandlerId_t handlerId, wsfEventMask_t event);
enginerd 0:b562096246b3 79
enginerd 0:b562096246b3 80 /*************************************************************************************************/
enginerd 0:b562096246b3 81 /*!
enginerd 0:b562096246b3 82 * \fn WsfTaskLock
enginerd 0:b562096246b3 83 *
enginerd 0:b562096246b3 84 * \brief Lock task scheduling.
enginerd 0:b562096246b3 85 *
enginerd 0:b562096246b3 86 * \return None.
enginerd 0:b562096246b3 87 */
enginerd 0:b562096246b3 88 /*************************************************************************************************/
enginerd 0:b562096246b3 89 void WsfTaskLock(void);
enginerd 0:b562096246b3 90
enginerd 0:b562096246b3 91 /*************************************************************************************************/
enginerd 0:b562096246b3 92 /*!
enginerd 0:b562096246b3 93 * \fn WsfTaskUnlock
enginerd 0:b562096246b3 94 *
enginerd 0:b562096246b3 95 * \brief Unlock task scheduling.
enginerd 0:b562096246b3 96 *
enginerd 0:b562096246b3 97 * \return None.
enginerd 0:b562096246b3 98 */
enginerd 0:b562096246b3 99 /*************************************************************************************************/
enginerd 0:b562096246b3 100 void WsfTaskUnlock(void);
enginerd 0:b562096246b3 101
enginerd 0:b562096246b3 102 /*************************************************************************************************/
enginerd 0:b562096246b3 103 /*!
enginerd 0:b562096246b3 104 * \fn WsfTaskSetReady
enginerd 0:b562096246b3 105 *
enginerd 0:b562096246b3 106 * \brief Set the task used by the given handler as ready to run.
enginerd 0:b562096246b3 107 *
enginerd 0:b562096246b3 108 * \param handlerId Event handler ID.
enginerd 0:b562096246b3 109 * \param event Task event mask.
enginerd 0:b562096246b3 110 *
enginerd 0:b562096246b3 111 * \return None.
enginerd 0:b562096246b3 112 */
enginerd 0:b562096246b3 113 /*************************************************************************************************/
enginerd 0:b562096246b3 114 void WsfTaskSetReady(wsfHandlerId_t handlerId, wsfTaskEvent_t event);
enginerd 0:b562096246b3 115
enginerd 0:b562096246b3 116 /*************************************************************************************************/
enginerd 0:b562096246b3 117 /*!
enginerd 0:b562096246b3 118 * \fn WsfTaskMsgQueue
enginerd 0:b562096246b3 119 *
enginerd 0:b562096246b3 120 * \brief Return the task message queue used by the given handler.
enginerd 0:b562096246b3 121 *
enginerd 0:b562096246b3 122 * \param handlerId Event handler ID.
enginerd 0:b562096246b3 123 *
enginerd 0:b562096246b3 124 * \return Task message queue.
enginerd 0:b562096246b3 125 */
enginerd 0:b562096246b3 126 /*************************************************************************************************/
enginerd 0:b562096246b3 127 wsfQueue_t *WsfTaskMsgQueue(wsfHandlerId_t handlerId);
enginerd 0:b562096246b3 128
enginerd 0:b562096246b3 129 /*************************************************************************************************/
enginerd 0:b562096246b3 130 /*!
enginerd 0:b562096246b3 131 * \fn WsfOsSetNextHandler
enginerd 0:b562096246b3 132 *
enginerd 0:b562096246b3 133 * \brief Set the next WSF handler function in the WSF OS handler array. This function
enginerd 0:b562096246b3 134 * should only be called as part of the OS initialization procedure.
enginerd 0:b562096246b3 135 *
enginerd 0:b562096246b3 136 * \param handler WSF handler function.
enginerd 0:b562096246b3 137 *
enginerd 0:b562096246b3 138 * \return WSF handler ID for this handler.
enginerd 0:b562096246b3 139 */
enginerd 0:b562096246b3 140 /*************************************************************************************************/
enginerd 0:b562096246b3 141 wsfHandlerId_t WsfOsSetNextHandler(wsfEventHandler_t handler);
enginerd 0:b562096246b3 142
enginerd 0:b562096246b3 143 #ifdef __cplusplus
enginerd 0:b562096246b3 144 };
enginerd 0:b562096246b3 145 #endif
enginerd 0:b562096246b3 146
enginerd 0:b562096246b3 147 #endif /* WSF_OS_H */