Patched version of nrf51822 FOTA compatible driver, with GPTIO disabled, as it clashed with the mbed definitions...

Fork of nRF51822 by Nordic Semiconductor

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ble_stack_handler_types.h Source File

ble_stack_handler_types.h

Go to the documentation of this file.
00001 /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
00002  *
00003  * The information contained herein is property of Nordic Semiconductor ASA.
00004  * Terms and conditions of usage are described in detail in NORDIC
00005  * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
00006  *
00007  * Licensees are granted free, non-transferable use of the information. NO
00008  * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
00009  * the file.
00010  *
00011  */
00012 
00013 /**@file
00014  *
00015  * @defgroup ble_stack_handler_types Types definitions for BLE support in SoftDevice handler.
00016  * @{
00017  * @ingroup  softdevice_handler
00018  * @brief    This file contains the declarations of types required for BLE stack support. These
00019  *           types will be defined when the preprocessor define BLE_STACK_SUPPORT_REQD is defined.
00020  */
00021 
00022 #ifndef BLE_STACK_HANDLER_TYPES_H__
00023 #define BLE_STACK_HANDLER_TYPES_H__
00024 
00025 #define BLE_STACK_SUPPORT_REQD
00026 
00027 #ifdef BLE_STACK_SUPPORT_REQD
00028 
00029 #include <stdlib.h>
00030 #include "ble.h"
00031 #include "nrf_sdm.h"
00032 #include "app_error.h "
00033 #include "app_scheduler.h "
00034 #include "app_util.h "
00035 
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif // #ifdef __cplusplus
00039 
00040 #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. */
00041 #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. */
00042 
00043 /**@brief Application stack event handler type. */
00044 typedef void (*ble_evt_handler_t) (ble_evt_t * p_ble_evt);
00045 
00046 /**@brief     Function for registering for BLE events.
00047  *
00048  * @details   The application should use this function to register for receiving BLE events from
00049  *            the SoftDevice. If the application does not call this function, then any BLE event
00050  *            that may be generated by the SoftDevice will NOT be fetched. Once the application has
00051  *            registered for the events, it is not possible to cancel the registration.
00052  *            However, it is possible to register a different function for handling the events at
00053  *            any point of time.
00054  *
00055  * @param[in] ble_evt_handler Function to be called for each received BLE event.
00056  *
00057  * @retval    NRF_SUCCESS     Successful registration.
00058  * @retval    NRF_ERROR_NULL  Null pointer provided as input.
00059  */
00060 uint32_t softdevice_ble_evt_handler_set(ble_evt_handler_t ble_evt_handler);
00061 
00062 #ifdef __cplusplus
00063 }
00064 #endif // #ifdef __cplusplus
00065 
00066 #else
00067 
00068 #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.*/
00069 #define BLE_STACK_HANDLER_SCHED_EVT_SIZE  0
00070 
00071 #endif // BLE_STACK_SUPPORT_REQD
00072 
00073 #endif // BLE_STACK_HANDLER_TYPES_H__
00074 
00075 /** @} */