iOSのBLEコントローラアプリ「RCBController」と接続し、コントローラの操作を取得するサンプルプログラムです。 mbed HRM1017で動作を確認しています。 2014.08.20時点でのBLEライブラリに対応しました。

Dependencies:   BLE_API mbed

Fork of BLE_RCBController by Junichi Katsu

Committer:
jksoft
Date:
Wed Aug 20 13:41:01 2014 +0000
Revision:
4:ebda47d22091
Parent:
nRF51822/nordic/nrf-sdk/sd_common/ble_stack_handler_types.h@1:48f6e08a3ac2
?????????

Who changed what in which revision?

UserRevisionLine numberNew 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 ble_stack_handler_types Types definitions for BLE 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 BLE stack support. These
jksoft 1:48f6e08a3ac2 19 * types will be defined when the preprocessor define BLE_STACK_SUPPORT_REQD is defined.
jksoft 1:48f6e08a3ac2 20 */
jksoft 1:48f6e08a3ac2 21
jksoft 1:48f6e08a3ac2 22 #ifndef BLE_STACK_HANDLER_TYPES_H__
jksoft 1:48f6e08a3ac2 23 #define BLE_STACK_HANDLER_TYPES_H__
jksoft 1:48f6e08a3ac2 24
jksoft 1:48f6e08a3ac2 25 #ifdef BLE_STACK_SUPPORT_REQD
jksoft 1:48f6e08a3ac2 26
jksoft 1:48f6e08a3ac2 27 #include <stdlib.h>
jksoft 1:48f6e08a3ac2 28 #include "ble.h"
jksoft 1:48f6e08a3ac2 29 #include "nrf_sdm.h"
jksoft 1:48f6e08a3ac2 30 #include "app_error.h"
jksoft 1:48f6e08a3ac2 31 #include "app_scheduler.h"
jksoft 1:48f6e08a3ac2 32 #include "app_util.h"
jksoft 1:48f6e08a3ac2 33
jksoft 1:48f6e08a3ac2 34 #ifdef __cplusplus
jksoft 1:48f6e08a3ac2 35 extern "C" {
jksoft 1:48f6e08a3ac2 36 #endif // #ifdef __cplusplus
jksoft 1:48f6e08a3ac2 37
jksoft 1:48f6e08a3ac2 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 1:48f6e08a3ac2 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 1:48f6e08a3ac2 40
jksoft 1:48f6e08a3ac2 41 /**@brief Application stack event handler type. */
jksoft 1:48f6e08a3ac2 42 typedef void (*ble_evt_handler_t) (ble_evt_t * p_ble_evt);
jksoft 1:48f6e08a3ac2 43
jksoft 1:48f6e08a3ac2 44 /**@brief Function for registering for BLE events.
jksoft 1:48f6e08a3ac2 45 *
jksoft 1:48f6e08a3ac2 46 * @details The application should use this function to register for receiving BLE events from
jksoft 1:48f6e08a3ac2 47 * the SoftDevice. If the application does not call this function, then any BLE event
jksoft 1:48f6e08a3ac2 48 * that may be generated by the SoftDevice will NOT be fetched. Once the application has
jksoft 1:48f6e08a3ac2 49 * registered for the events, it is not possible to possible to cancel the registration.
jksoft 1:48f6e08a3ac2 50 * However, it is possible to register a different function for handling the events at
jksoft 1:48f6e08a3ac2 51 * any point of time.
jksoft 1:48f6e08a3ac2 52 *
jksoft 1:48f6e08a3ac2 53 * @param[in] ble_evt_handler Function to be called for each received BLE event.
jksoft 1:48f6e08a3ac2 54 *
jksoft 1:48f6e08a3ac2 55 * @retval NRF_SUCCESS Successful registration.
jksoft 1:48f6e08a3ac2 56 * @retval NRF_ERROR_NULL Null pointer provided as input.
jksoft 1:48f6e08a3ac2 57 */
jksoft 1:48f6e08a3ac2 58 uint32_t softdevice_ble_evt_handler_set(ble_evt_handler_t ble_evt_handler);
jksoft 1:48f6e08a3ac2 59
jksoft 1:48f6e08a3ac2 60 #else
jksoft 1:48f6e08a3ac2 61
jksoft 1:48f6e08a3ac2 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 1:48f6e08a3ac2 63 #define BLE_STACK_HANDLER_SCHED_EVT_SIZE 0
jksoft 1:48f6e08a3ac2 64
jksoft 1:48f6e08a3ac2 65 #endif // BLE_STACK_SUPPORT_REQD
jksoft 1:48f6e08a3ac2 66
jksoft 1:48f6e08a3ac2 67 #ifdef __cplusplus
jksoft 1:48f6e08a3ac2 68 }
jksoft 1:48f6e08a3ac2 69 #endif // #ifdef __cplusplus
jksoft 1:48f6e08a3ac2 70
jksoft 1:48f6e08a3ac2 71 #endif // BLE_STACK_HANDLER_TYPES_H__
jksoft 1:48f6e08a3ac2 72
jksoft 1:48f6e08a3ac2 73 /** @} */