Junichi Katsu
/
BLE_MPU6050_test6_challenge_sb
テスト用です。
nRF51822_wallbot/nordic/nrf-sdk/ble/ble_services/ble_dis.h@0:8468a4403fea, 2016-10-11 (annotated)
- Committer:
- jksoft
- Date:
- Tue Oct 11 11:09:42 2016 +0000
- Revision:
- 0:8468a4403fea
SB??ver;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jksoft | 0:8468a4403fea | 1 | /* Copyright (c) 2012 Nordic Semiconductor. All Rights Reserved. |
jksoft | 0:8468a4403fea | 2 | * |
jksoft | 0:8468a4403fea | 3 | * The information contained herein is property of Nordic Semiconductor ASA. |
jksoft | 0:8468a4403fea | 4 | * Terms and conditions of usage are described in detail in NORDIC |
jksoft | 0:8468a4403fea | 5 | * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. |
jksoft | 0:8468a4403fea | 6 | * |
jksoft | 0:8468a4403fea | 7 | * Licensees are granted free, non-transferable use of the information. NO |
jksoft | 0:8468a4403fea | 8 | * WARRANTY of ANY KIND is provided. This heading must NOT be removed from |
jksoft | 0:8468a4403fea | 9 | * the file. |
jksoft | 0:8468a4403fea | 10 | * |
jksoft | 0:8468a4403fea | 11 | */ |
jksoft | 0:8468a4403fea | 12 | |
jksoft | 0:8468a4403fea | 13 | /** @file |
jksoft | 0:8468a4403fea | 14 | * |
jksoft | 0:8468a4403fea | 15 | * @defgroup ble_sdk_srv_dis Device Information Service |
jksoft | 0:8468a4403fea | 16 | * @{ |
jksoft | 0:8468a4403fea | 17 | * @ingroup ble_sdk_srv |
jksoft | 0:8468a4403fea | 18 | * @brief Device Information Service module. |
jksoft | 0:8468a4403fea | 19 | * |
jksoft | 0:8468a4403fea | 20 | * @details This module implements the Device Information Service. |
jksoft | 0:8468a4403fea | 21 | * During initialization it adds the Device Information Service to the BLE stack database. |
jksoft | 0:8468a4403fea | 22 | * It then encodes the supplied information, and adds the curresponding characteristics. |
jksoft | 0:8468a4403fea | 23 | * |
jksoft | 0:8468a4403fea | 24 | * @note Attention! |
jksoft | 0:8468a4403fea | 25 | * To maintain compliance with Nordic Semiconductor ASA Bluetooth profile |
jksoft | 0:8468a4403fea | 26 | * qualification listings, this section of source code must not be modified. |
jksoft | 0:8468a4403fea | 27 | */ |
jksoft | 0:8468a4403fea | 28 | |
jksoft | 0:8468a4403fea | 29 | #ifndef BLE_DIS_H__ |
jksoft | 0:8468a4403fea | 30 | #define BLE_DIS_H__ |
jksoft | 0:8468a4403fea | 31 | |
jksoft | 0:8468a4403fea | 32 | #include <stdint.h> |
jksoft | 0:8468a4403fea | 33 | #include "ble_srv_common.h" |
jksoft | 0:8468a4403fea | 34 | |
jksoft | 0:8468a4403fea | 35 | // Vendor ID Source values |
jksoft | 0:8468a4403fea | 36 | #define BLE_DIS_VENDOR_ID_SRC_BLUETOOTH_SIG 1 /**< Vendor ID assigned by Bluetooth SIG. */ |
jksoft | 0:8468a4403fea | 37 | #define BLE_DIS_VENDOR_ID_SRC_USB_IMPL_FORUM 2 /**< Vendor ID assigned by USB Implementer's Forum. */ |
jksoft | 0:8468a4403fea | 38 | |
jksoft | 0:8468a4403fea | 39 | /**@brief System ID parameters */ |
jksoft | 0:8468a4403fea | 40 | typedef struct |
jksoft | 0:8468a4403fea | 41 | { |
jksoft | 0:8468a4403fea | 42 | uint64_t manufacturer_id; /**< Manufacturer ID. Only 5 LSOs shall be used. */ |
jksoft | 0:8468a4403fea | 43 | uint32_t organizationally_unique_id; /**< Organizationally unique ID. Only 3 LSOs shall be used. */ |
jksoft | 0:8468a4403fea | 44 | } ble_dis_sys_id_t; |
jksoft | 0:8468a4403fea | 45 | |
jksoft | 0:8468a4403fea | 46 | /**@brief IEEE 11073-20601 Regulatory Certification Data List Structure */ |
jksoft | 0:8468a4403fea | 47 | typedef struct |
jksoft | 0:8468a4403fea | 48 | { |
jksoft | 0:8468a4403fea | 49 | uint8_t * p_list; /**< Pointer the byte array containing the encoded opaque structure based on IEEE 11073-20601 specification. */ |
jksoft | 0:8468a4403fea | 50 | uint8_t list_len; /**< Length of the byte array. */ |
jksoft | 0:8468a4403fea | 51 | } ble_dis_reg_cert_data_list_t; |
jksoft | 0:8468a4403fea | 52 | |
jksoft | 0:8468a4403fea | 53 | /**@brief PnP ID parameters */ |
jksoft | 0:8468a4403fea | 54 | typedef struct |
jksoft | 0:8468a4403fea | 55 | { |
jksoft | 0:8468a4403fea | 56 | uint8_t vendor_id_source; /**< Vendor ID Source. see @ref DIS_VENDOR_ID_SRC_VALUES. */ |
jksoft | 0:8468a4403fea | 57 | uint16_t vendor_id; /**< Vendor ID. */ |
jksoft | 0:8468a4403fea | 58 | uint16_t product_id; /**< Product ID. */ |
jksoft | 0:8468a4403fea | 59 | uint16_t product_version; /**< Product Version. */ |
jksoft | 0:8468a4403fea | 60 | } ble_dis_pnp_id_t; |
jksoft | 0:8468a4403fea | 61 | |
jksoft | 0:8468a4403fea | 62 | /**@brief Device Information Service init structure. This contains all possible characteristics |
jksoft | 0:8468a4403fea | 63 | * needed for initialization of the service. |
jksoft | 0:8468a4403fea | 64 | */ |
jksoft | 0:8468a4403fea | 65 | typedef struct |
jksoft | 0:8468a4403fea | 66 | { |
jksoft | 0:8468a4403fea | 67 | ble_srv_utf8_str_t manufact_name_str; /**< Manufacturer Name String. */ |
jksoft | 0:8468a4403fea | 68 | ble_srv_utf8_str_t model_num_str; /**< Model Number String. */ |
jksoft | 0:8468a4403fea | 69 | ble_srv_utf8_str_t serial_num_str; /**< Serial Number String. */ |
jksoft | 0:8468a4403fea | 70 | ble_srv_utf8_str_t hw_rev_str; /**< Hardware Revision String. */ |
jksoft | 0:8468a4403fea | 71 | ble_srv_utf8_str_t fw_rev_str; /**< Firmware Revision String. */ |
jksoft | 0:8468a4403fea | 72 | ble_srv_utf8_str_t sw_rev_str; /**< Software Revision String. */ |
jksoft | 0:8468a4403fea | 73 | ble_dis_sys_id_t * p_sys_id; /**< System ID. */ |
jksoft | 0:8468a4403fea | 74 | ble_dis_reg_cert_data_list_t * p_reg_cert_data_list; /**< IEEE 11073-20601 Regulatory Certification Data List. */ |
jksoft | 0:8468a4403fea | 75 | ble_dis_pnp_id_t * p_pnp_id; /**< PnP ID. */ |
jksoft | 0:8468a4403fea | 76 | ble_srv_security_mode_t dis_attr_md; /**< Initial Security Setting for Device Information Characteristics. */ |
jksoft | 0:8468a4403fea | 77 | } ble_dis_init_t; |
jksoft | 0:8468a4403fea | 78 | |
jksoft | 0:8468a4403fea | 79 | /**@brief Function for initializing the Device Information Service. |
jksoft | 0:8468a4403fea | 80 | * |
jksoft | 0:8468a4403fea | 81 | * @details This call allows the application to initialize the device information service. |
jksoft | 0:8468a4403fea | 82 | * It adds the DIS service and DIS characteristics to the database, using the initial |
jksoft | 0:8468a4403fea | 83 | * values supplied through the p_dis_init parameter. Characteristics which are not to be |
jksoft | 0:8468a4403fea | 84 | * added, shall be set to NULL in p_dis_init. |
jksoft | 0:8468a4403fea | 85 | * |
jksoft | 0:8468a4403fea | 86 | * @param[in] p_dis_init The structure containing the values of characteristics needed by the |
jksoft | 0:8468a4403fea | 87 | * service. |
jksoft | 0:8468a4403fea | 88 | * |
jksoft | 0:8468a4403fea | 89 | * @return NRF_SUCCESS on successful initialization of service. |
jksoft | 0:8468a4403fea | 90 | */ |
jksoft | 0:8468a4403fea | 91 | uint32_t ble_dis_init(const ble_dis_init_t * p_dis_init); |
jksoft | 0:8468a4403fea | 92 | |
jksoft | 0:8468a4403fea | 93 | #endif // BLE_DIS_H__ |
jksoft | 0:8468a4403fea | 94 | |
jksoft | 0:8468a4403fea | 95 | /** @} */ |