![](/media/cache/profiles/5f14615696649541a025d3d0f8e0447f.jpg.50x50_q85.jpg)
テスト用です。
nRF51822_wallbot/nordic/nrf-sdk/sd_common/ble_stack_handler_types.h@0:8468a4403fea, 2016-10-11 (annotated)
- Committer:
- jksoft
- Date:
- Tue Oct 11 11:09:42 2016 +0000
- Revision:
- 0:8468a4403fea
SB??ver;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jksoft | 0:8468a4403fea | 1 | /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. |
jksoft | 0:8468a4403fea | 2 | * |
jksoft | 0:8468a4403fea | 3 | * The information contained herein is property of Nordic Semiconductor ASA. |
jksoft | 0:8468a4403fea | 4 | * Terms and conditions of usage are described in detail in NORDIC |
jksoft | 0:8468a4403fea | 5 | * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. |
jksoft | 0:8468a4403fea | 6 | * |
jksoft | 0:8468a4403fea | 7 | * Licensees are granted free, non-transferable use of the information. NO |
jksoft | 0:8468a4403fea | 8 | * WARRANTY of ANY KIND is provided. This heading must NOT be removed from |
jksoft | 0:8468a4403fea | 9 | * the file. |
jksoft | 0:8468a4403fea | 10 | * |
jksoft | 0:8468a4403fea | 11 | */ |
jksoft | 0:8468a4403fea | 12 | |
jksoft | 0:8468a4403fea | 13 | /**@file |
jksoft | 0:8468a4403fea | 14 | * |
jksoft | 0:8468a4403fea | 15 | * @defgroup ble_stack_handler_types Types definitions for BLE support in SoftDevice handler. |
jksoft | 0:8468a4403fea | 16 | * @{ |
jksoft | 0:8468a4403fea | 17 | * @ingroup softdevice_handler |
jksoft | 0:8468a4403fea | 18 | * @brief This file contains the declarations of types required for BLE stack support. These |
jksoft | 0:8468a4403fea | 19 | * types will be defined when the preprocessor define BLE_STACK_SUPPORT_REQD is defined. |
jksoft | 0:8468a4403fea | 20 | */ |
jksoft | 0:8468a4403fea | 21 | |
jksoft | 0:8468a4403fea | 22 | #ifndef BLE_STACK_HANDLER_TYPES_H__ |
jksoft | 0:8468a4403fea | 23 | #define BLE_STACK_HANDLER_TYPES_H__ |
jksoft | 0:8468a4403fea | 24 | |
jksoft | 0:8468a4403fea | 25 | #ifdef BLE_STACK_SUPPORT_REQD |
jksoft | 0:8468a4403fea | 26 | |
jksoft | 0:8468a4403fea | 27 | #include <stdlib.h> |
jksoft | 0:8468a4403fea | 28 | #include "ble.h" |
jksoft | 0:8468a4403fea | 29 | #include "nrf_sdm.h" |
jksoft | 0:8468a4403fea | 30 | #include "app_error.h" |
jksoft | 0:8468a4403fea | 31 | #include "app_scheduler.h" |
jksoft | 0:8468a4403fea | 32 | #include "app_util.h" |
jksoft | 0:8468a4403fea | 33 | |
jksoft | 0:8468a4403fea | 34 | #ifdef __cplusplus |
jksoft | 0:8468a4403fea | 35 | extern "C" { |
jksoft | 0:8468a4403fea | 36 | #endif // #ifdef __cplusplus |
jksoft | 0:8468a4403fea | 37 | |
jksoft | 0:8468a4403fea | 38 | #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. */ |
jksoft | 0:8468a4403fea | 39 | #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. */ |
jksoft | 0:8468a4403fea | 40 | |
jksoft | 0:8468a4403fea | 41 | /**@brief Application stack event handler type. */ |
jksoft | 0:8468a4403fea | 42 | typedef void (*ble_evt_handler_t) (ble_evt_t * p_ble_evt); |
jksoft | 0:8468a4403fea | 43 | |
jksoft | 0:8468a4403fea | 44 | /**@brief Function for registering for BLE events. |
jksoft | 0:8468a4403fea | 45 | * |
jksoft | 0:8468a4403fea | 46 | * @details The application should use this function to register for receiving BLE events from |
jksoft | 0:8468a4403fea | 47 | * the SoftDevice. If the application does not call this function, then any BLE event |
jksoft | 0:8468a4403fea | 48 | * that may be generated by the SoftDevice will NOT be fetched. Once the application has |
jksoft | 0:8468a4403fea | 49 | * registered for the events, it is not possible to possible to cancel the registration. |
jksoft | 0:8468a4403fea | 50 | * However, it is possible to register a different function for handling the events at |
jksoft | 0:8468a4403fea | 51 | * any point of time. |
jksoft | 0:8468a4403fea | 52 | * |
jksoft | 0:8468a4403fea | 53 | * @param[in] ble_evt_handler Function to be called for each received BLE event. |
jksoft | 0:8468a4403fea | 54 | * |
jksoft | 0:8468a4403fea | 55 | * @retval NRF_SUCCESS Successful registration. |
jksoft | 0:8468a4403fea | 56 | * @retval NRF_ERROR_NULL Null pointer provided as input. |
jksoft | 0:8468a4403fea | 57 | */ |
jksoft | 0:8468a4403fea | 58 | uint32_t softdevice_ble_evt_handler_set(ble_evt_handler_t ble_evt_handler); |
jksoft | 0:8468a4403fea | 59 | |
jksoft | 0:8468a4403fea | 60 | #else |
jksoft | 0:8468a4403fea | 61 | |
jksoft | 0:8468a4403fea | 62 | #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.*/ |
jksoft | 0:8468a4403fea | 63 | #define BLE_STACK_HANDLER_SCHED_EVT_SIZE 0 |
jksoft | 0:8468a4403fea | 64 | |
jksoft | 0:8468a4403fea | 65 | #endif // BLE_STACK_SUPPORT_REQD |
jksoft | 0:8468a4403fea | 66 | |
jksoft | 0:8468a4403fea | 67 | #ifdef __cplusplus |
jksoft | 0:8468a4403fea | 68 | } |
jksoft | 0:8468a4403fea | 69 | #endif // #ifdef __cplusplus |
jksoft | 0:8468a4403fea | 70 | |
jksoft | 0:8468a4403fea | 71 | #endif // BLE_STACK_HANDLER_TYPES_H__ |
jksoft | 0:8468a4403fea | 72 | |
jksoft | 0:8468a4403fea | 73 | /** @} */ |