Nordic nrf51 sdk sources. Mirrored from https://github.com/ARMmbed/nrf51-sdk.

Dependents:   nRF51822 nRF51822

Committer:
vcoubard
Date:
Thu Apr 07 17:37:56 2016 +0100
Revision:
28:041dac1366b2
Parent:
21:d9932bd925d0
Child:
29:286940b7ee5a
Synchronized with git rev 012b8118
Author: Liyou Zhou
Pull in files from sdk 10.0

Who changed what in which revision?

UserRevisionLine numberNew contents of line
vcoubard 28:041dac1366b2 1 /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
vcoubard 28:041dac1366b2 2 *
vcoubard 28:041dac1366b2 3 * The information contained herein is property of Nordic Semiconductor ASA.
vcoubard 28:041dac1366b2 4 * Terms and conditions of usage are described in detail in NORDIC
vcoubard 28:041dac1366b2 5 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
vcoubard 28:041dac1366b2 6 *
vcoubard 28:041dac1366b2 7 * Licensees are granted free, non-transferable use of the information. NO
vcoubard 28:041dac1366b2 8 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
vcoubard 28:041dac1366b2 9 * the file.
vcoubard 28:041dac1366b2 10 *
Vincent Coubard 0:f2542974c862 11 */
Vincent Coubard 0:f2542974c862 12
Vincent Coubard 0:f2542974c862 13 /**@file
Vincent Coubard 0:f2542974c862 14 *
Vincent Coubard 0:f2542974c862 15 * @defgroup ble_stack_handler_types Types definitions for BLE support in SoftDevice handler.
Vincent Coubard 0:f2542974c862 16 * @{
Vincent Coubard 0:f2542974c862 17 * @ingroup softdevice_handler
Vincent Coubard 0:f2542974c862 18 * @brief This file contains the declarations of types required for BLE stack support. These
Vincent Coubard 0:f2542974c862 19 * types will be defined when the preprocessor define BLE_STACK_SUPPORT_REQD is defined.
Vincent Coubard 0:f2542974c862 20 */
Vincent Coubard 0:f2542974c862 21
Vincent Coubard 0:f2542974c862 22 #ifndef BLE_STACK_HANDLER_TYPES_H__
Vincent Coubard 0:f2542974c862 23 #define BLE_STACK_HANDLER_TYPES_H__
Vincent Coubard 0:f2542974c862 24
Vincent Coubard 0:f2542974c862 25 #ifdef BLE_STACK_SUPPORT_REQD
Vincent Coubard 0:f2542974c862 26
Vincent Coubard 0:f2542974c862 27 #include <stdlib.h>
Vincent Coubard 0:f2542974c862 28 #include "ble.h"
Vincent Coubard 0:f2542974c862 29 #include "nrf_sdm.h"
Vincent Coubard 0:f2542974c862 30 #include "app_error.h"
Vincent Coubard 0:f2542974c862 31 #include "app_util.h"
Vincent Coubard 0:f2542974c862 32
Vincent Coubard 0:f2542974c862 33 #define BLE_STACK_EVT_MSG_BUF_SIZE (sizeof(ble_evt_t) + (GATT_MTU_SIZE_DEFAULT)) /**< Size of BLE event message buffer. This will be provided to the SoftDevice while fetching an event. */
Vincent Coubard 0:f2542974c862 34 #define BLE_STACK_HANDLER_SCHED_EVT_SIZE 0 /**< The size of the scheduler event used by SoftDevice handler when passing BLE events using the @ref app_scheduler. */
Vincent Coubard 0:f2542974c862 35
Vincent Coubard 0:f2542974c862 36 /**@brief Application stack event handler type. */
Vincent Coubard 0:f2542974c862 37 typedef void (*ble_evt_handler_t) (ble_evt_t * p_ble_evt);
Vincent Coubard 0:f2542974c862 38
Vincent Coubard 0:f2542974c862 39 /**@brief Function for registering for BLE events.
Vincent Coubard 0:f2542974c862 40 *
Vincent Coubard 0:f2542974c862 41 * @details The application should use this function to register for receiving BLE events from
Vincent Coubard 0:f2542974c862 42 * the SoftDevice. If the application does not call this function, then any BLE event
Vincent Coubard 0:f2542974c862 43 * that may be generated by the SoftDevice will NOT be fetched. Once the application has
Vincent Coubard 0:f2542974c862 44 * registered for the events, it is not possible to cancel the registration.
Vincent Coubard 0:f2542974c862 45 * However, it is possible to register a different function for handling the events at
Vincent Coubard 0:f2542974c862 46 * any point of time.
Vincent Coubard 0:f2542974c862 47 *
Vincent Coubard 0:f2542974c862 48 * @param[in] ble_evt_handler Function to be called for each received BLE event.
Vincent Coubard 0:f2542974c862 49 *
Vincent Coubard 0:f2542974c862 50 * @retval NRF_SUCCESS Successful registration.
Vincent Coubard 0:f2542974c862 51 * @retval NRF_ERROR_NULL Null pointer provided as input.
Vincent Coubard 0:f2542974c862 52 */
Vincent Coubard 0:f2542974c862 53 uint32_t softdevice_ble_evt_handler_set(ble_evt_handler_t ble_evt_handler);
Vincent Coubard 0:f2542974c862 54
Vincent Coubard 0:f2542974c862 55 #else
Vincent Coubard 0:f2542974c862 56
Vincent Coubard 0:f2542974c862 57 #define BLE_STACK_EVT_MSG_BUF_SIZE 0 /**< Since the BLE stack support is not required, this is equated to 0, so that the @ref softdevice_handler.h can compute the internal event buffer size without having to care for BLE events.*/
Vincent Coubard 0:f2542974c862 58 #define BLE_STACK_HANDLER_SCHED_EVT_SIZE 0
Vincent Coubard 0:f2542974c862 59
Vincent Coubard 0:f2542974c862 60 #endif // BLE_STACK_SUPPORT_REQD
Vincent Coubard 0:f2542974c862 61
Vincent Coubard 0:f2542974c862 62 #endif // BLE_STACK_HANDLER_TYPES_H__
Vincent Coubard 0:f2542974c862 63
vcoubard 1:ebc0e0ef0a11 64 /** @} */