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/s110/ble_types.h@1:48f6e08a3ac2
?????????

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jksoft 1:48f6e08a3ac2 1 /* Copyright (c) 2011 Nordic Semiconductor. All Rights Reserved.
jksoft 1:48f6e08a3ac2 2 *
jksoft 1:48f6e08a3ac2 3 * The information contained herein is confidential property of Nordic Semiconductor. The use,
jksoft 1:48f6e08a3ac2 4 * copying, transfer or disclosure of such information is prohibited except by express written
jksoft 1:48f6e08a3ac2 5 * agreement with Nordic Semiconductor.
jksoft 1:48f6e08a3ac2 6 *
jksoft 1:48f6e08a3ac2 7 */
jksoft 1:48f6e08a3ac2 8 /**
jksoft 1:48f6e08a3ac2 9 @addtogroup BLE_COMMON
jksoft 1:48f6e08a3ac2 10 @{
jksoft 1:48f6e08a3ac2 11 @defgroup ble_types Common types and macro definitions
jksoft 1:48f6e08a3ac2 12 @{
jksoft 1:48f6e08a3ac2 13
jksoft 1:48f6e08a3ac2 14 @brief Common types and macro definitions for the S110 SoftDevice.
jksoft 1:48f6e08a3ac2 15 */
jksoft 1:48f6e08a3ac2 16
jksoft 1:48f6e08a3ac2 17 #ifndef BLE_TYPES_H__
jksoft 1:48f6e08a3ac2 18 #define BLE_TYPES_H__
jksoft 1:48f6e08a3ac2 19
jksoft 1:48f6e08a3ac2 20 #include <stdint.h>
jksoft 1:48f6e08a3ac2 21
jksoft 1:48f6e08a3ac2 22 /** @addtogroup BLE_COMMON_DEFINES Defines
jksoft 1:48f6e08a3ac2 23 * @{ */
jksoft 1:48f6e08a3ac2 24
jksoft 1:48f6e08a3ac2 25 /** @defgroup BLE_CONN_HANDLES BLE Connection Handles
jksoft 1:48f6e08a3ac2 26 * @{ */
jksoft 1:48f6e08a3ac2 27 #define BLE_CONN_HANDLE_INVALID 0xFFFF /**< Invalid Connection Handle. */
jksoft 1:48f6e08a3ac2 28 #define BLE_CONN_HANDLE_ALL 0xFFFE /**< Applies to all Connection Handles. */
jksoft 1:48f6e08a3ac2 29 /** @} */
jksoft 1:48f6e08a3ac2 30
jksoft 1:48f6e08a3ac2 31
jksoft 1:48f6e08a3ac2 32
jksoft 1:48f6e08a3ac2 33
jksoft 1:48f6e08a3ac2 34
jksoft 1:48f6e08a3ac2 35 /** @defgroup BLE_UUID_TYPES Types of UUID
jksoft 1:48f6e08a3ac2 36 * @{ */
jksoft 1:48f6e08a3ac2 37 #define BLE_UUID_TYPE_UNKNOWN 0x00 /**< Invalid UUID type. */
jksoft 1:48f6e08a3ac2 38 #define BLE_UUID_TYPE_BLE 0x01 /**< Bluetooth SIG UUID (16-bit). */
jksoft 1:48f6e08a3ac2 39 #define BLE_UUID_TYPE_VENDOR_BEGIN 0x02 /**< Vendor UUID types start at this index (128-bit). */
jksoft 1:48f6e08a3ac2 40 /** @} */
jksoft 1:48f6e08a3ac2 41
jksoft 1:48f6e08a3ac2 42 /** @brief Set .type and .uuid fields of ble_uuid_struct to specified uuid value. */
jksoft 1:48f6e08a3ac2 43 #define BLE_UUID_BLE_ASSIGN(instance, value) do {\
jksoft 1:48f6e08a3ac2 44 instance.type = BLE_UUID_TYPE_BLE; \
jksoft 1:48f6e08a3ac2 45 instance.uuid = value;} while(0)
jksoft 1:48f6e08a3ac2 46
jksoft 1:48f6e08a3ac2 47 /** @brief Copy type and uuid members from src to dst ble_uuid_t pointer. Both pointers must be valid/non-null. */
jksoft 1:48f6e08a3ac2 48 #define BLE_UUID_COPY_PTR(dst, src) do {\
jksoft 1:48f6e08a3ac2 49 (dst)->type = (src)->type; \
jksoft 1:48f6e08a3ac2 50 (dst)->uuid = (src)->uuid;} while(0)
jksoft 1:48f6e08a3ac2 51
jksoft 1:48f6e08a3ac2 52 /** @brief Copy type and uuid members from src to dst ble_uuid_t struct. */
jksoft 1:48f6e08a3ac2 53 #define BLE_UUID_COPY_INST(dst, src) do {\
jksoft 1:48f6e08a3ac2 54 (dst).type = (src).type; \
jksoft 1:48f6e08a3ac2 55 (dst).uuid = (src).uuid;} while(0)
jksoft 1:48f6e08a3ac2 56
jksoft 1:48f6e08a3ac2 57 /** @brief Compare for equality both type and uuid members of two (valid, non-null) ble_uuid_t pointers. */
jksoft 1:48f6e08a3ac2 58 #define BLE_UUID_EQ(p_uuid1, p_uuid2) \
jksoft 1:48f6e08a3ac2 59 (((p_uuid1)->type == (p_uuid2)->type) && ((p_uuid1)->uuid == (p_uuid2)->uuid))
jksoft 1:48f6e08a3ac2 60
jksoft 1:48f6e08a3ac2 61 /** @brief Compare for difference both type and uuid members of two (valid, non-null) ble_uuid_t pointers. */
jksoft 1:48f6e08a3ac2 62 #define BLE_UUID_NEQ(p_uuid1, p_uuid2) \
jksoft 1:48f6e08a3ac2 63 (((p_uuid1)->type != (p_uuid2)->type) || ((p_uuid1)->uuid != (p_uuid2)->uuid))
jksoft 1:48f6e08a3ac2 64
jksoft 1:48f6e08a3ac2 65 /** @} */
jksoft 1:48f6e08a3ac2 66
jksoft 1:48f6e08a3ac2 67 /** @addtogroup BLE_TYPES_STRUCTURES Structures
jksoft 1:48f6e08a3ac2 68 * @{ */
jksoft 1:48f6e08a3ac2 69
jksoft 1:48f6e08a3ac2 70 /** @brief 128 bit UUID values. */
jksoft 1:48f6e08a3ac2 71 typedef struct
jksoft 1:48f6e08a3ac2 72 {
jksoft 1:48f6e08a3ac2 73 unsigned char uuid128[16];
jksoft 1:48f6e08a3ac2 74 } ble_uuid128_t;
jksoft 1:48f6e08a3ac2 75
jksoft 1:48f6e08a3ac2 76 /** @brief Bluetooth Low Energy UUID type, encapsulates both 16-bit and 128-bit UUIDs. */
jksoft 1:48f6e08a3ac2 77 typedef struct
jksoft 1:48f6e08a3ac2 78 {
jksoft 1:48f6e08a3ac2 79 uint16_t uuid; /**< 16-bit UUID value or octets 12-13 of 128-bit UUID. */
jksoft 1:48f6e08a3ac2 80 uint8_t type; /**< UUID type, see @ref BLE_UUID_TYPES. If type is BLE_UUID_TYPE_UNKNOWN, the value of uuid is undefined. */
jksoft 1:48f6e08a3ac2 81 } ble_uuid_t;
jksoft 1:48f6e08a3ac2 82
jksoft 1:48f6e08a3ac2 83 /** @} */
jksoft 1:48f6e08a3ac2 84
jksoft 1:48f6e08a3ac2 85 #endif /* BLE_TYPES_H__ */
jksoft 1:48f6e08a3ac2 86
jksoft 1:48f6e08a3ac2 87 /**
jksoft 1:48f6e08a3ac2 88 @}
jksoft 1:48f6e08a3ac2 89 @}
jksoft 1:48f6e08a3ac2 90 */