nochanges

Dependents:   BLE_Acceleration_Statejudging

Fork of nRF51822 by Nordic Semiconductor

Committer:
Rohit Grover
Date:
Mon Jul 07 13:43:31 2014 +0100
Revision:
37:c29c330d942c
Child:
65:98215c4f3a25
changes required to upgrade to V7 of the soft-device

Who changed what in which revision?

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