iOSのBLEコントローラアプリ「RCBController」と接続し、コントローラの操作を取得するサンプルプログラムです。 mbed HRM1017で動作を確認しています。 2014.08.20時点でのBLEライブラリに対応しました。
Fork of BLE_RCBController by
nRF51822/nordic/nrf-sdk/sd_common/ant_stack_handler_types.h@1:48f6e08a3ac2, 2014-08-20 (annotated)
- Committer:
- jksoft
- Date:
- Wed Aug 20 13:24:20 2014 +0000
- Revision:
- 1:48f6e08a3ac2
2014.08.20?????BLE?????????????; ???mbed?????????????????; mbed HRM1017; Nordic nRF51822
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jksoft | 1:48f6e08a3ac2 | 1 | /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. |
jksoft | 1:48f6e08a3ac2 | 2 | * |
jksoft | 1:48f6e08a3ac2 | 3 | * The information contained herein is property of Nordic Semiconductor ASA. |
jksoft | 1:48f6e08a3ac2 | 4 | * Terms and conditions of usage are described in detail in NORDIC |
jksoft | 1:48f6e08a3ac2 | 5 | * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. |
jksoft | 1:48f6e08a3ac2 | 6 | * |
jksoft | 1:48f6e08a3ac2 | 7 | * Licensees are granted free, non-transferable use of the information. NO |
jksoft | 1:48f6e08a3ac2 | 8 | * WARRANTY of ANY KIND is provided. This heading must NOT be removed from |
jksoft | 1:48f6e08a3ac2 | 9 | * the file. |
jksoft | 1:48f6e08a3ac2 | 10 | * |
jksoft | 1:48f6e08a3ac2 | 11 | */ |
jksoft | 1:48f6e08a3ac2 | 12 | |
jksoft | 1:48f6e08a3ac2 | 13 | /**@file |
jksoft | 1:48f6e08a3ac2 | 14 | * |
jksoft | 1:48f6e08a3ac2 | 15 | * @defgroup ant_stack_handler_types Types definitions for ANT support in SoftDevice handler. |
jksoft | 1:48f6e08a3ac2 | 16 | * @{ |
jksoft | 1:48f6e08a3ac2 | 17 | * @ingroup softdevice_handler |
jksoft | 1:48f6e08a3ac2 | 18 | * @brief This file contains the declarations of types required for ANT stack support. These |
jksoft | 1:48f6e08a3ac2 | 19 | * types will be defined when the preprocessor define ANT_STACK_SUPPORT_REQD is defined. |
jksoft | 1:48f6e08a3ac2 | 20 | */ |
jksoft | 1:48f6e08a3ac2 | 21 | |
jksoft | 1:48f6e08a3ac2 | 22 | #ifndef ANT_STACK_HANDLER_TYPES_H__ |
jksoft | 1:48f6e08a3ac2 | 23 | #define ANT_STACK_HANDLER_TYPES_H__ |
jksoft | 1:48f6e08a3ac2 | 24 | |
jksoft | 1:48f6e08a3ac2 | 25 | #ifdef ANT_STACK_SUPPORT_REQD |
jksoft | 1:48f6e08a3ac2 | 26 | |
jksoft | 1:48f6e08a3ac2 | 27 | #include <stdlib.h> |
jksoft | 1:48f6e08a3ac2 | 28 | |
jksoft | 1:48f6e08a3ac2 | 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. */ |
jksoft | 1:48f6e08a3ac2 | 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. */ |
jksoft | 1:48f6e08a3ac2 | 31 | |
jksoft | 1:48f6e08a3ac2 | 32 | /**@brief ANT stack event type. */ |
jksoft | 1:48f6e08a3ac2 | 33 | typedef struct |
jksoft | 1:48f6e08a3ac2 | 34 | { |
jksoft | 1:48f6e08a3ac2 | 35 | uint8_t channel; /**< Channel number. */ |
jksoft | 1:48f6e08a3ac2 | 36 | uint8_t event; /**< Event code. */ |
jksoft | 1:48f6e08a3ac2 | 37 | uint8_t evt_buffer[ANT_STACK_EVT_MSG_BUF_SIZE]; /**< Event message buffer. */ |
jksoft | 1:48f6e08a3ac2 | 38 | } ant_evt_t; |
jksoft | 1:48f6e08a3ac2 | 39 | |
jksoft | 1:48f6e08a3ac2 | 40 | /**@brief Application ANT stack event handler type. */ |
jksoft | 1:48f6e08a3ac2 | 41 | typedef void (*ant_evt_handler_t) (ant_evt_t * p_ant_evt); |
jksoft | 1:48f6e08a3ac2 | 42 | |
jksoft | 1:48f6e08a3ac2 | 43 | /**@brief Function for registering for ANT events. |
jksoft | 1:48f6e08a3ac2 | 44 | * |
jksoft | 1:48f6e08a3ac2 | 45 | * @details The application should use this function to register for receiving ANT events from |
jksoft | 1:48f6e08a3ac2 | 46 | * the SoftDevice. If the application does not call this function, then any ANT event |
jksoft | 1:48f6e08a3ac2 | 47 | * that may be generated by the SoftDevice will NOT be fetched. Once the application has |
jksoft | 1:48f6e08a3ac2 | 48 | * registered for the events, it is not possible to possible to cancel the registration. |
jksoft | 1:48f6e08a3ac2 | 49 | * However, it is possible to register a different function for handling the events at |
jksoft | 1:48f6e08a3ac2 | 50 | * any point of time. |
jksoft | 1:48f6e08a3ac2 | 51 | * |
jksoft | 1:48f6e08a3ac2 | 52 | * @param[in] ant_evt_handler Function to be called for each received ANT event. |
jksoft | 1:48f6e08a3ac2 | 53 | * |
jksoft | 1:48f6e08a3ac2 | 54 | * @retval NRF_SUCCESS Successful registration. |
jksoft | 1:48f6e08a3ac2 | 55 | * @retval NRF_ERROR_NULL Null pointer provided as input. |
jksoft | 1:48f6e08a3ac2 | 56 | */ |
jksoft | 1:48f6e08a3ac2 | 57 | uint32_t softdevice_ant_evt_handler_set(ant_evt_handler_t ant_evt_handler); |
jksoft | 1:48f6e08a3ac2 | 58 | |
jksoft | 1:48f6e08a3ac2 | 59 | #else |
jksoft | 1:48f6e08a3ac2 | 60 | |
jksoft | 1:48f6e08a3ac2 | 61 | // The ANT Stack support is not required. |
jksoft | 1:48f6e08a3ac2 | 62 | |
jksoft | 1:48f6e08a3ac2 | 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.*/ |
jksoft | 1:48f6e08a3ac2 | 64 | |
jksoft | 1:48f6e08a3ac2 | 65 | #endif // ANT_STACK_SUPPORT_REQD |
jksoft | 1:48f6e08a3ac2 | 66 | |
jksoft | 1:48f6e08a3ac2 | 67 | #endif // ANT_STACK_HANDLER_TYPES_H__ |
jksoft | 1:48f6e08a3ac2 | 68 | |
jksoft | 1:48f6e08a3ac2 | 69 | /** @} */ |