iOSのBLEコントローラアプリ「RCBController」と接続し、コントローラの操作を取得するサンプルプログラムです。 mbed HRM1017で動作を確認しています。 2014.08.20時点でのBLEライブラリに対応しました。
Fork of BLE_RCBController by
HRM1017/nordic/nrf-sdk/ble/ble_services/ble_dis.h@4:ebda47d22091, 2014-08-20 (annotated)
- Committer:
- jksoft
- Date:
- Wed Aug 20 13:41:01 2014 +0000
- Revision:
- 4:ebda47d22091
- Parent:
- nRF51822/nordic/nrf-sdk/ble/ble_services/ble_dis.h@1:48f6e08a3ac2
?????????
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jksoft | 1:48f6e08a3ac2 | 1 | /* Copyright (c) 2012 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_sdk_srv_dis Device Information Service |
jksoft | 1:48f6e08a3ac2 | 16 | * @{ |
jksoft | 1:48f6e08a3ac2 | 17 | * @ingroup ble_sdk_srv |
jksoft | 1:48f6e08a3ac2 | 18 | * @brief Device Information Service module. |
jksoft | 1:48f6e08a3ac2 | 19 | * |
jksoft | 1:48f6e08a3ac2 | 20 | * @details This module implements the Device Information Service. |
jksoft | 1:48f6e08a3ac2 | 21 | * During initialization it adds the Device Information Service to the BLE stack database. |
jksoft | 1:48f6e08a3ac2 | 22 | * It then encodes the supplied information, and adds the curresponding characteristics. |
jksoft | 1:48f6e08a3ac2 | 23 | * |
jksoft | 1:48f6e08a3ac2 | 24 | * @note Attention! |
jksoft | 1:48f6e08a3ac2 | 25 | * To maintain compliance with Nordic Semiconductor ASA Bluetooth profile |
jksoft | 1:48f6e08a3ac2 | 26 | * qualification listings, this section of source code must not be modified. |
jksoft | 1:48f6e08a3ac2 | 27 | */ |
jksoft | 1:48f6e08a3ac2 | 28 | |
jksoft | 1:48f6e08a3ac2 | 29 | #ifndef BLE_DIS_H__ |
jksoft | 1:48f6e08a3ac2 | 30 | #define BLE_DIS_H__ |
jksoft | 1:48f6e08a3ac2 | 31 | |
jksoft | 1:48f6e08a3ac2 | 32 | #include <stdint.h> |
jksoft | 1:48f6e08a3ac2 | 33 | #include "ble_srv_common.h" |
jksoft | 1:48f6e08a3ac2 | 34 | |
jksoft | 1:48f6e08a3ac2 | 35 | // Vendor ID Source values |
jksoft | 1:48f6e08a3ac2 | 36 | #define BLE_DIS_VENDOR_ID_SRC_BLUETOOTH_SIG 1 /**< Vendor ID assigned by Bluetooth SIG. */ |
jksoft | 1:48f6e08a3ac2 | 37 | #define BLE_DIS_VENDOR_ID_SRC_USB_IMPL_FORUM 2 /**< Vendor ID assigned by USB Implementer's Forum. */ |
jksoft | 1:48f6e08a3ac2 | 38 | |
jksoft | 1:48f6e08a3ac2 | 39 | /**@brief System ID parameters */ |
jksoft | 1:48f6e08a3ac2 | 40 | typedef struct |
jksoft | 1:48f6e08a3ac2 | 41 | { |
jksoft | 1:48f6e08a3ac2 | 42 | uint64_t manufacturer_id; /**< Manufacturer ID. Only 5 LSOs shall be used. */ |
jksoft | 1:48f6e08a3ac2 | 43 | uint32_t organizationally_unique_id; /**< Organizationally unique ID. Only 3 LSOs shall be used. */ |
jksoft | 1:48f6e08a3ac2 | 44 | } ble_dis_sys_id_t; |
jksoft | 1:48f6e08a3ac2 | 45 | |
jksoft | 1:48f6e08a3ac2 | 46 | /**@brief IEEE 11073-20601 Regulatory Certification Data List Structure */ |
jksoft | 1:48f6e08a3ac2 | 47 | typedef struct |
jksoft | 1:48f6e08a3ac2 | 48 | { |
jksoft | 1:48f6e08a3ac2 | 49 | uint8_t * p_list; /**< Pointer the byte array containing the encoded opaque structure based on IEEE 11073-20601 specification. */ |
jksoft | 1:48f6e08a3ac2 | 50 | uint8_t list_len; /**< Length of the byte array. */ |
jksoft | 1:48f6e08a3ac2 | 51 | } ble_dis_reg_cert_data_list_t; |
jksoft | 1:48f6e08a3ac2 | 52 | |
jksoft | 1:48f6e08a3ac2 | 53 | /**@brief PnP ID parameters */ |
jksoft | 1:48f6e08a3ac2 | 54 | typedef struct |
jksoft | 1:48f6e08a3ac2 | 55 | { |
jksoft | 1:48f6e08a3ac2 | 56 | uint8_t vendor_id_source; /**< Vendor ID Source. see @ref DIS_VENDOR_ID_SRC_VALUES. */ |
jksoft | 1:48f6e08a3ac2 | 57 | uint16_t vendor_id; /**< Vendor ID. */ |
jksoft | 1:48f6e08a3ac2 | 58 | uint16_t product_id; /**< Product ID. */ |
jksoft | 1:48f6e08a3ac2 | 59 | uint16_t product_version; /**< Product Version. */ |
jksoft | 1:48f6e08a3ac2 | 60 | } ble_dis_pnp_id_t; |
jksoft | 1:48f6e08a3ac2 | 61 | |
jksoft | 1:48f6e08a3ac2 | 62 | /**@brief Device Information Service init structure. This contains all possible characteristics |
jksoft | 1:48f6e08a3ac2 | 63 | * needed for initialization of the service. |
jksoft | 1:48f6e08a3ac2 | 64 | */ |
jksoft | 1:48f6e08a3ac2 | 65 | typedef struct |
jksoft | 1:48f6e08a3ac2 | 66 | { |
jksoft | 1:48f6e08a3ac2 | 67 | ble_srv_utf8_str_t manufact_name_str; /**< Manufacturer Name String. */ |
jksoft | 1:48f6e08a3ac2 | 68 | ble_srv_utf8_str_t model_num_str; /**< Model Number String. */ |
jksoft | 1:48f6e08a3ac2 | 69 | ble_srv_utf8_str_t serial_num_str; /**< Serial Number String. */ |
jksoft | 1:48f6e08a3ac2 | 70 | ble_srv_utf8_str_t hw_rev_str; /**< Hardware Revision String. */ |
jksoft | 1:48f6e08a3ac2 | 71 | ble_srv_utf8_str_t fw_rev_str; /**< Firmware Revision String. */ |
jksoft | 1:48f6e08a3ac2 | 72 | ble_srv_utf8_str_t sw_rev_str; /**< Software Revision String. */ |
jksoft | 1:48f6e08a3ac2 | 73 | ble_dis_sys_id_t * p_sys_id; /**< System ID. The helper function @ref dis_sys_id_encode can be used to encode the value of this characteristic. */ |
jksoft | 1:48f6e08a3ac2 | 74 | ble_dis_reg_cert_data_list_t * p_reg_cert_data_list; /**< IEEE 11073-20601 Regulatory Certification Data List. */ |
jksoft | 1:48f6e08a3ac2 | 75 | ble_dis_pnp_id_t * p_pnp_id; /**< PnP ID. The helper function @ref dis_pnp_id_encode can be used to encode the value of this characteristic. */ |
jksoft | 1:48f6e08a3ac2 | 76 | ble_srv_security_mode_t dis_attr_md; /**< Initial Security Setting for Device Information Characteristics. */ |
jksoft | 1:48f6e08a3ac2 | 77 | } ble_dis_init_t; |
jksoft | 1:48f6e08a3ac2 | 78 | |
jksoft | 1:48f6e08a3ac2 | 79 | /**@brief Function for initializing the Device Information Service. |
jksoft | 1:48f6e08a3ac2 | 80 | * |
jksoft | 1:48f6e08a3ac2 | 81 | * @details This call allows the application to initialize the device information service. |
jksoft | 1:48f6e08a3ac2 | 82 | * It adds the DIS service and DIS characteristics to the database, using the initial |
jksoft | 1:48f6e08a3ac2 | 83 | * values supplied through the p_dis_init parameter. Characteristics which are not to be |
jksoft | 1:48f6e08a3ac2 | 84 | * added, shall be set to NULL in p_dis_init. |
jksoft | 1:48f6e08a3ac2 | 85 | * |
jksoft | 1:48f6e08a3ac2 | 86 | * @param[in] p_dis_init The structure containing the values of characteristics needed by the |
jksoft | 1:48f6e08a3ac2 | 87 | * service. |
jksoft | 1:48f6e08a3ac2 | 88 | * |
jksoft | 1:48f6e08a3ac2 | 89 | * @return NRF_SUCCESS on successful initialization of service. |
jksoft | 1:48f6e08a3ac2 | 90 | */ |
jksoft | 1:48f6e08a3ac2 | 91 | uint32_t ble_dis_init(const ble_dis_init_t * p_dis_init); |
jksoft | 1:48f6e08a3ac2 | 92 | |
jksoft | 1:48f6e08a3ac2 | 93 | #endif // BLE_DIS_H__ |
jksoft | 1:48f6e08a3ac2 | 94 | |
jksoft | 1:48f6e08a3ac2 | 95 | /** @} */ |