konashi/SBBLEのテスト

Dependencies:   BLE_API mbed

Fork of BLE_LoopbackUART by Bluetooth Low Energy

Committer:
robo8080
Date:
Sat Aug 16 02:10:08 2014 +0000
Revision:
5:61109bce11fe
test1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
robo8080 5:61109bce11fe 1 /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
robo8080 5:61109bce11fe 2 *
robo8080 5:61109bce11fe 3 * The information contained herein is property of Nordic Semiconductor ASA.
robo8080 5:61109bce11fe 4 * Terms and conditions of usage are described in detail in NORDIC
robo8080 5:61109bce11fe 5 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
robo8080 5:61109bce11fe 6 *
robo8080 5:61109bce11fe 7 * Licensees are granted free, non-transferable use of the information. NO
robo8080 5:61109bce11fe 8 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
robo8080 5:61109bce11fe 9 * the file.
robo8080 5:61109bce11fe 10 *
robo8080 5:61109bce11fe 11 */
robo8080 5:61109bce11fe 12
robo8080 5:61109bce11fe 13 /**@file
robo8080 5:61109bce11fe 14 *
robo8080 5:61109bce11fe 15 * @defgroup ant_stack_handler_types Types definitions for ANT support in SoftDevice handler.
robo8080 5:61109bce11fe 16 * @{
robo8080 5:61109bce11fe 17 * @ingroup softdevice_handler
robo8080 5:61109bce11fe 18 * @brief This file contains the declarations of types required for ANT stack support. These
robo8080 5:61109bce11fe 19 * types will be defined when the preprocessor define ANT_STACK_SUPPORT_REQD is defined.
robo8080 5:61109bce11fe 20 */
robo8080 5:61109bce11fe 21
robo8080 5:61109bce11fe 22 #ifndef ANT_STACK_HANDLER_TYPES_H__
robo8080 5:61109bce11fe 23 #define ANT_STACK_HANDLER_TYPES_H__
robo8080 5:61109bce11fe 24
robo8080 5:61109bce11fe 25 #ifdef ANT_STACK_SUPPORT_REQD
robo8080 5:61109bce11fe 26
robo8080 5:61109bce11fe 27 #include <stdlib.h>
robo8080 5:61109bce11fe 28
robo8080 5:61109bce11fe 29 #define ANT_STACK_EVT_MSG_BUF_SIZE 32 /**< Size of ANT event message buffer. This will be provided to the SoftDevice while fetching an event. */
robo8080 5:61109bce11fe 30 #define ANT_STACK_EVT_STRUCT_SIZE (sizeof(ant_evt_t)) /**< Size of the @ref ant_evt_t structure. This will be used by the @ref softdevice_handler.h to internal event buffer size needed. */
robo8080 5:61109bce11fe 31
robo8080 5:61109bce11fe 32 /**@brief ANT stack event type. */
robo8080 5:61109bce11fe 33 typedef struct
robo8080 5:61109bce11fe 34 {
robo8080 5:61109bce11fe 35 uint8_t channel; /**< Channel number. */
robo8080 5:61109bce11fe 36 uint8_t event; /**< Event code. */
robo8080 5:61109bce11fe 37 uint8_t evt_buffer[ANT_STACK_EVT_MSG_BUF_SIZE]; /**< Event message buffer. */
robo8080 5:61109bce11fe 38 } ant_evt_t;
robo8080 5:61109bce11fe 39
robo8080 5:61109bce11fe 40 /**@brief Application ANT stack event handler type. */
robo8080 5:61109bce11fe 41 typedef void (*ant_evt_handler_t) (ant_evt_t * p_ant_evt);
robo8080 5:61109bce11fe 42
robo8080 5:61109bce11fe 43 /**@brief Function for registering for ANT events.
robo8080 5:61109bce11fe 44 *
robo8080 5:61109bce11fe 45 * @details The application should use this function to register for receiving ANT events from
robo8080 5:61109bce11fe 46 * the SoftDevice. If the application does not call this function, then any ANT event
robo8080 5:61109bce11fe 47 * that may be generated by the SoftDevice will NOT be fetched. Once the application has
robo8080 5:61109bce11fe 48 * registered for the events, it is not possible to possible to cancel the registration.
robo8080 5:61109bce11fe 49 * However, it is possible to register a different function for handling the events at
robo8080 5:61109bce11fe 50 * any point of time.
robo8080 5:61109bce11fe 51 *
robo8080 5:61109bce11fe 52 * @param[in] ant_evt_handler Function to be called for each received ANT event.
robo8080 5:61109bce11fe 53 *
robo8080 5:61109bce11fe 54 * @retval NRF_SUCCESS Successful registration.
robo8080 5:61109bce11fe 55 * @retval NRF_ERROR_NULL Null pointer provided as input.
robo8080 5:61109bce11fe 56 */
robo8080 5:61109bce11fe 57 uint32_t softdevice_ant_evt_handler_set(ant_evt_handler_t ant_evt_handler);
robo8080 5:61109bce11fe 58
robo8080 5:61109bce11fe 59 #else
robo8080 5:61109bce11fe 60
robo8080 5:61109bce11fe 61 // The ANT Stack support is not required.
robo8080 5:61109bce11fe 62
robo8080 5:61109bce11fe 63 #define ANT_STACK_EVT_STRUCT_SIZE 0 /**< Since the ANT 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 ANT events.*/
robo8080 5:61109bce11fe 64
robo8080 5:61109bce11fe 65 #endif // ANT_STACK_SUPPORT_REQD
robo8080 5:61109bce11fe 66
robo8080 5:61109bce11fe 67 #endif // ANT_STACK_HANDLER_TYPES_H__
robo8080 5:61109bce11fe 68
robo8080 5:61109bce11fe 69 /** @} */