Nordic stack and drivers for the mbed BLE API
Fork of nRF51822 by
TARGET_MCU_NRF51822/sdk/source/ble/common/ble_srv_common.h@638:c90ae1400bf2, 2016-09-14 (annotated)
- Committer:
- Vincent Coubard
- Date:
- Wed Sep 14 14:39:43 2016 +0100
- Revision:
- 638:c90ae1400bf2
Sync with bdab10dc0f90748b6989c8b577771bb403ca6bd8 from ARMmbed/mbed-os.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Vincent Coubard |
638:c90ae1400bf2 | 1 | /* |
Vincent Coubard |
638:c90ae1400bf2 | 2 | * Copyright (c) Nordic Semiconductor ASA |
Vincent Coubard |
638:c90ae1400bf2 | 3 | * All rights reserved. |
Vincent Coubard |
638:c90ae1400bf2 | 4 | * |
Vincent Coubard |
638:c90ae1400bf2 | 5 | * Redistribution and use in source and binary forms, with or without modification, |
Vincent Coubard |
638:c90ae1400bf2 | 6 | * are permitted provided that the following conditions are met: |
Vincent Coubard |
638:c90ae1400bf2 | 7 | * |
Vincent Coubard |
638:c90ae1400bf2 | 8 | * 1. Redistributions of source code must retain the above copyright notice, this |
Vincent Coubard |
638:c90ae1400bf2 | 9 | * list of conditions and the following disclaimer. |
Vincent Coubard |
638:c90ae1400bf2 | 10 | * |
Vincent Coubard |
638:c90ae1400bf2 | 11 | * 2. Redistributions in binary form must reproduce the above copyright notice, this |
Vincent Coubard |
638:c90ae1400bf2 | 12 | * list of conditions and the following disclaimer in the documentation and/or |
Vincent Coubard |
638:c90ae1400bf2 | 13 | * other materials provided with the distribution. |
Vincent Coubard |
638:c90ae1400bf2 | 14 | * |
Vincent Coubard |
638:c90ae1400bf2 | 15 | * 3. Neither the name of Nordic Semiconductor ASA nor the names of other |
Vincent Coubard |
638:c90ae1400bf2 | 16 | * contributors to this software may be used to endorse or promote products |
Vincent Coubard |
638:c90ae1400bf2 | 17 | * derived from this software without specific prior written permission. |
Vincent Coubard |
638:c90ae1400bf2 | 18 | * |
Vincent Coubard |
638:c90ae1400bf2 | 19 | * |
Vincent Coubard |
638:c90ae1400bf2 | 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
Vincent Coubard |
638:c90ae1400bf2 | 21 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
Vincent Coubard |
638:c90ae1400bf2 | 22 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
Vincent Coubard |
638:c90ae1400bf2 | 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR |
Vincent Coubard |
638:c90ae1400bf2 | 24 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
Vincent Coubard |
638:c90ae1400bf2 | 25 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
Vincent Coubard |
638:c90ae1400bf2 | 26 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
Vincent Coubard |
638:c90ae1400bf2 | 27 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
Vincent Coubard |
638:c90ae1400bf2 | 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
Vincent Coubard |
638:c90ae1400bf2 | 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Vincent Coubard |
638:c90ae1400bf2 | 30 | * |
Vincent Coubard |
638:c90ae1400bf2 | 31 | */ |
Vincent Coubard |
638:c90ae1400bf2 | 32 | |
Vincent Coubard |
638:c90ae1400bf2 | 33 | /** @file |
Vincent Coubard |
638:c90ae1400bf2 | 34 | * |
Vincent Coubard |
638:c90ae1400bf2 | 35 | * @defgroup ble_sdk_srv_common Common service definitions |
Vincent Coubard |
638:c90ae1400bf2 | 36 | * @{ |
Vincent Coubard |
638:c90ae1400bf2 | 37 | * @ingroup ble_sdk_srv |
Vincent Coubard |
638:c90ae1400bf2 | 38 | * @brief Constants, type definitions, and functions that are common to all services. |
Vincent Coubard |
638:c90ae1400bf2 | 39 | */ |
Vincent Coubard |
638:c90ae1400bf2 | 40 | |
Vincent Coubard |
638:c90ae1400bf2 | 41 | #ifndef BLE_SRV_COMMON_H__ |
Vincent Coubard |
638:c90ae1400bf2 | 42 | #define BLE_SRV_COMMON_H__ |
Vincent Coubard |
638:c90ae1400bf2 | 43 | |
Vincent Coubard |
638:c90ae1400bf2 | 44 | #include <stdint.h> |
Vincent Coubard |
638:c90ae1400bf2 | 45 | #include <stdbool.h> |
Vincent Coubard |
638:c90ae1400bf2 | 46 | #include "ble_types.h" |
Vincent Coubard |
638:c90ae1400bf2 | 47 | #include "app_util.h" |
Vincent Coubard |
638:c90ae1400bf2 | 48 | #include "nrf_ble.h" |
Vincent Coubard |
638:c90ae1400bf2 | 49 | #include "ble_gap.h" |
Vincent Coubard |
638:c90ae1400bf2 | 50 | #include "ble_gatt.h" |
Vincent Coubard |
638:c90ae1400bf2 | 51 | |
Vincent Coubard |
638:c90ae1400bf2 | 52 | /** @defgroup UUID_SERVICES Service UUID definitions |
Vincent Coubard |
638:c90ae1400bf2 | 53 | * @{ */ |
Vincent Coubard |
638:c90ae1400bf2 | 54 | #define BLE_UUID_ALERT_NOTIFICATION_SERVICE 0x1811 /**< Alert Notification service UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 55 | #define BLE_UUID_BATTERY_SERVICE 0x180F /**< Battery service UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 56 | #define BLE_UUID_BLOOD_PRESSURE_SERVICE 0x1810 /**< Blood Pressure service UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 57 | #define BLE_UUID_CURRENT_TIME_SERVICE 0x1805 /**< Current Time service UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 58 | #define BLE_UUID_CYCLING_SPEED_AND_CADENCE 0x1816 /**< Cycling Speed and Cadence service UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 59 | #define BLE_UUID_LOCATION_AND_NAVIGATION_SERVICE 0x1819 /**< Location and Navigation service UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 60 | #define BLE_UUID_DEVICE_INFORMATION_SERVICE 0x180A /**< Device Information service UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 61 | #define BLE_UUID_GLUCOSE_SERVICE 0x1808 /**< Glucose service UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 62 | #define BLE_UUID_HEALTH_THERMOMETER_SERVICE 0x1809 /**< Health Thermometer service UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 63 | #define BLE_UUID_HEART_RATE_SERVICE 0x180D /**< Heart Rate service UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 64 | #define BLE_UUID_HUMAN_INTERFACE_DEVICE_SERVICE 0x1812 /**< Human Interface Device service UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 65 | #define BLE_UUID_IMMEDIATE_ALERT_SERVICE 0x1802 /**< Immediate Alert service UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 66 | #define BLE_UUID_LINK_LOSS_SERVICE 0x1803 /**< Link Loss service UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 67 | #define BLE_UUID_NEXT_DST_CHANGE_SERVICE 0x1807 /**< Next Dst Change service UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 68 | #define BLE_UUID_PHONE_ALERT_STATUS_SERVICE 0x180E /**< Phone Alert Status service UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 69 | #define BLE_UUID_REFERENCE_TIME_UPDATE_SERVICE 0x1806 /**< Reference Time Update service UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 70 | #define BLE_UUID_RUNNING_SPEED_AND_CADENCE 0x1814 /**< Running Speed and Cadence service UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 71 | #define BLE_UUID_SCAN_PARAMETERS_SERVICE 0x1813 /**< Scan Parameters service UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 72 | #define BLE_UUID_TX_POWER_SERVICE 0x1804 /**< TX Power service UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 73 | #define BLE_UUID_IPSP_SERVICE 0x1820 /**< Internet Protocol Support service UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 74 | /** @} */ |
Vincent Coubard |
638:c90ae1400bf2 | 75 | |
Vincent Coubard |
638:c90ae1400bf2 | 76 | /** @defgroup UUID_CHARACTERISTICS Characteristic UUID definitions |
Vincent Coubard |
638:c90ae1400bf2 | 77 | * @{ */ |
Vincent Coubard |
638:c90ae1400bf2 | 78 | #define BLE_UUID_BATTERY_LEVEL_STATE_CHAR 0x2A1B /**< Battery Level State characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 79 | #define BLE_UUID_BATTERY_POWER_STATE_CHAR 0x2A1A /**< Battery Power State characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 80 | #define BLE_UUID_REMOVABLE_CHAR 0x2A3A /**< Removable characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 81 | #define BLE_UUID_SERVICE_REQUIRED_CHAR 0x2A3B /**< Service Required characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 82 | #define BLE_UUID_ALERT_CATEGORY_ID_CHAR 0x2A43 /**< Alert Category Id characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 83 | #define BLE_UUID_ALERT_CATEGORY_ID_BIT_MASK_CHAR 0x2A42 /**< Alert Category Id Bit Mask characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 84 | #define BLE_UUID_ALERT_LEVEL_CHAR 0x2A06 /**< Alert Level characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 85 | #define BLE_UUID_ALERT_NOTIFICATION_CONTROL_POINT_CHAR 0x2A44 /**< Alert Notification Control Point characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 86 | #define BLE_UUID_ALERT_STATUS_CHAR 0x2A3F /**< Alert Status characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 87 | #define BLE_UUID_BATTERY_LEVEL_CHAR 0x2A19 /**< Battery Level characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 88 | #define BLE_UUID_BLOOD_PRESSURE_FEATURE_CHAR 0x2A49 /**< Blood Pressure Feature characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 89 | #define BLE_UUID_BLOOD_PRESSURE_MEASUREMENT_CHAR 0x2A35 /**< Blood Pressure Measurement characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 90 | #define BLE_UUID_BODY_SENSOR_LOCATION_CHAR 0x2A38 /**< Body Sensor Location characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 91 | #define BLE_UUID_BOOT_KEYBOARD_INPUT_REPORT_CHAR 0x2A22 /**< Boot Keyboard Input Report characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 92 | #define BLE_UUID_BOOT_KEYBOARD_OUTPUT_REPORT_CHAR 0x2A32 /**< Boot Keyboard Output Report characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 93 | #define BLE_UUID_BOOT_MOUSE_INPUT_REPORT_CHAR 0x2A33 /**< Boot Mouse Input Report characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 94 | #define BLE_UUID_CURRENT_TIME_CHAR 0x2A2B /**< Current Time characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 95 | #define BLE_UUID_DATE_TIME_CHAR 0x2A08 /**< Date Time characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 96 | #define BLE_UUID_DAY_DATE_TIME_CHAR 0x2A0A /**< Day Date Time characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 97 | #define BLE_UUID_DAY_OF_WEEK_CHAR 0x2A09 /**< Day Of Week characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 98 | #define BLE_UUID_DST_OFFSET_CHAR 0x2A0D /**< Dst Offset characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 99 | #define BLE_UUID_EXACT_TIME_256_CHAR 0x2A0C /**< Exact Time 256 characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 100 | #define BLE_UUID_FIRMWARE_REVISION_STRING_CHAR 0x2A26 /**< Firmware Revision String characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 101 | #define BLE_UUID_GLUCOSE_FEATURE_CHAR 0x2A51 /**< Glucose Feature characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 102 | #define BLE_UUID_GLUCOSE_MEASUREMENT_CHAR 0x2A18 /**< Glucose Measurement characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 103 | #define BLE_UUID_GLUCOSE_MEASUREMENT_CONTEXT_CHAR 0x2A34 /**< Glucose Measurement Context characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 104 | #define BLE_UUID_HARDWARE_REVISION_STRING_CHAR 0x2A27 /**< Hardware Revision String characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 105 | #define BLE_UUID_HEART_RATE_CONTROL_POINT_CHAR 0x2A39 /**< Heart Rate Control Point characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 106 | #define BLE_UUID_HEART_RATE_MEASUREMENT_CHAR 0x2A37 /**< Heart Rate Measurement characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 107 | #define BLE_UUID_HID_CONTROL_POINT_CHAR 0x2A4C /**< Hid Control Point characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 108 | #define BLE_UUID_HID_INFORMATION_CHAR 0x2A4A /**< Hid Information characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 109 | #define BLE_UUID_IEEE_REGULATORY_CERTIFICATION_DATA_LIST_CHAR 0x2A2A /**< IEEE Regulatory Certification Data List characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 110 | #define BLE_UUID_INTERMEDIATE_CUFF_PRESSURE_CHAR 0x2A36 /**< Intermediate Cuff Pressure characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 111 | #define BLE_UUID_INTERMEDIATE_TEMPERATURE_CHAR 0x2A1E /**< Intermediate Temperature characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 112 | #define BLE_UUID_LOCAL_TIME_INFORMATION_CHAR 0x2A0F /**< Local Time Information characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 113 | #define BLE_UUID_MANUFACTURER_NAME_STRING_CHAR 0x2A29 /**< Manufacturer Name String characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 114 | #define BLE_UUID_MEASUREMENT_INTERVAL_CHAR 0x2A21 /**< Measurement Interval characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 115 | #define BLE_UUID_MODEL_NUMBER_STRING_CHAR 0x2A24 /**< Model Number String characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 116 | #define BLE_UUID_UNREAD_ALERT_CHAR 0x2A45 /**< Unread Alert characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 117 | #define BLE_UUID_NEW_ALERT_CHAR 0x2A46 /**< New Alert characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 118 | #define BLE_UUID_PNP_ID_CHAR 0x2A50 /**< PNP Id characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 119 | #define BLE_UUID_PROTOCOL_MODE_CHAR 0x2A4E /**< Protocol Mode characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 120 | #define BLE_UUID_RECORD_ACCESS_CONTROL_POINT_CHAR 0x2A52 /**< Record Access Control Point characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 121 | #define BLE_UUID_REFERENCE_TIME_INFORMATION_CHAR 0x2A14 /**< Reference Time Information characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 122 | #define BLE_UUID_REPORT_CHAR 0x2A4D /**< Report characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 123 | #define BLE_UUID_REPORT_MAP_CHAR 0x2A4B /**< Report Map characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 124 | #define BLE_UUID_RINGER_CONTROL_POINT_CHAR 0x2A40 /**< Ringer Control Point characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 125 | #define BLE_UUID_RINGER_SETTING_CHAR 0x2A41 /**< Ringer Setting characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 126 | #define BLE_UUID_SCAN_INTERVAL_WINDOW_CHAR 0x2A4F /**< Scan Interval Window characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 127 | #define BLE_UUID_SCAN_REFRESH_CHAR 0x2A31 /**< Scan Refresh characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 128 | #define BLE_UUID_SERIAL_NUMBER_STRING_CHAR 0x2A25 /**< Serial Number String characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 129 | #define BLE_UUID_SOFTWARE_REVISION_STRING_CHAR 0x2A28 /**< Software Revision String characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 130 | #define BLE_UUID_SUPPORTED_NEW_ALERT_CATEGORY_CHAR 0x2A47 /**< Supported New Alert Category characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 131 | #define BLE_UUID_SUPPORTED_UNREAD_ALERT_CATEGORY_CHAR 0x2A48 /**< Supported Unread Alert Category characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 132 | #define BLE_UUID_SYSTEM_ID_CHAR 0x2A23 /**< System Id characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 133 | #define BLE_UUID_TEMPERATURE_MEASUREMENT_CHAR 0x2A1C /**< Temperature Measurement characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 134 | #define BLE_UUID_TEMPERATURE_TYPE_CHAR 0x2A1D /**< Temperature Type characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 135 | #define BLE_UUID_TIME_ACCURACY_CHAR 0x2A12 /**< Time Accuracy characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 136 | #define BLE_UUID_TIME_SOURCE_CHAR 0x2A13 /**< Time Source characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 137 | #define BLE_UUID_TIME_UPDATE_CONTROL_POINT_CHAR 0x2A16 /**< Time Update Control Point characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 138 | #define BLE_UUID_TIME_UPDATE_STATE_CHAR 0x2A17 /**< Time Update State characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 139 | #define BLE_UUID_TIME_WITH_DST_CHAR 0x2A11 /**< Time With Dst characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 140 | #define BLE_UUID_TIME_ZONE_CHAR 0x2A0E /**< Time Zone characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 141 | #define BLE_UUID_TX_POWER_LEVEL_CHAR 0x2A07 /**< TX Power Level characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 142 | #define BLE_UUID_CSC_FEATURE_CHAR 0x2A5C /**< Cycling Speed and Cadence Feature characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 143 | #define BLE_UUID_CSC_MEASUREMENT_CHAR 0x2A5B /**< Cycling Speed and Cadence Measurement characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 144 | #define BLE_UUID_RSC_FEATURE_CHAR 0x2A54 /**< Running Speed and Cadence Feature characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 145 | #define BLE_UUID_SC_CTRLPT_CHAR 0x2A55 /**< Speed and Cadence Control Point UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 146 | #define BLE_UUID_RSC_MEASUREMENT_CHAR 0x2A53 /**< Running Speed and Cadence Measurement characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 147 | #define BLE_UUID_SENSOR_LOCATION_CHAR 0x2A5D /**< Sensor Location characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 148 | #define BLE_UUID_EXTERNAL_REPORT_REF_DESCR 0x2907 /**< External Report Reference descriptor UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 149 | #define BLE_UUID_REPORT_REF_DESCR 0x2908 /**< Report Reference descriptor UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 150 | #define BLE_UUID_LN_FEATURE_CHAR 0x2A6A /**< Location Navigation Service, Feature characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 151 | #define BLE_UUID_LN_POSITION_QUALITY_CHAR 0x2A69 /**< Location Navigation Service, Position quality UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 152 | #define BLE_UUID_LN_LOCATION_AND_SPEED_CHAR 0x2A67 /**< Location Navigation Service, Location and Speed characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 153 | #define BLE_UUID_LN_NAVIGATION_CHAR 0x2A68 /**< Location Navigation Service, Navigation characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 154 | #define BLE_UUID_LN_CONTROL_POINT_CHAR 0x2A6B /**< Location Navigation Service, Control point characteristic UUID. */ |
Vincent Coubard |
638:c90ae1400bf2 | 155 | /** @} */ |
Vincent Coubard |
638:c90ae1400bf2 | 156 | |
Vincent Coubard |
638:c90ae1400bf2 | 157 | /** @defgroup ALERT_LEVEL_VALUES Definitions for the Alert Level characteristic values |
Vincent Coubard |
638:c90ae1400bf2 | 158 | * @{ */ |
Vincent Coubard |
638:c90ae1400bf2 | 159 | #define BLE_CHAR_ALERT_LEVEL_NO_ALERT 0x00 /**< No Alert. */ |
Vincent Coubard |
638:c90ae1400bf2 | 160 | #define BLE_CHAR_ALERT_LEVEL_MILD_ALERT 0x01 /**< Mild Alert. */ |
Vincent Coubard |
638:c90ae1400bf2 | 161 | #define BLE_CHAR_ALERT_LEVEL_HIGH_ALERT 0x02 /**< High Alert. */ |
Vincent Coubard |
638:c90ae1400bf2 | 162 | /** @} */ |
Vincent Coubard |
638:c90ae1400bf2 | 163 | |
Vincent Coubard |
638:c90ae1400bf2 | 164 | #define BLE_SRV_ENCODED_REPORT_REF_LEN 2 /**< The length of an encoded Report Reference Descriptor. */ |
Vincent Coubard |
638:c90ae1400bf2 | 165 | #define BLE_CCCD_VALUE_LEN 2 /**< The length of a CCCD value. */ |
Vincent Coubard |
638:c90ae1400bf2 | 166 | |
Vincent Coubard |
638:c90ae1400bf2 | 167 | /**@brief Type definition for error handler function that will be called in case of an error in |
Vincent Coubard |
638:c90ae1400bf2 | 168 | * a service or a service library module. */ |
Vincent Coubard |
638:c90ae1400bf2 | 169 | typedef void (*ble_srv_error_handler_t) (uint32_t nrf_error); |
Vincent Coubard |
638:c90ae1400bf2 | 170 | |
Vincent Coubard |
638:c90ae1400bf2 | 171 | |
Vincent Coubard |
638:c90ae1400bf2 | 172 | |
Vincent Coubard |
638:c90ae1400bf2 | 173 | /**@brief Value of a Report Reference descriptor. |
Vincent Coubard |
638:c90ae1400bf2 | 174 | * |
Vincent Coubard |
638:c90ae1400bf2 | 175 | * @details This is mapping information that maps the parent characteristic to the Report ID(s) and |
Vincent Coubard |
638:c90ae1400bf2 | 176 | * Report Type(s) defined within a Report Map characteristic. |
Vincent Coubard |
638:c90ae1400bf2 | 177 | */ |
Vincent Coubard |
638:c90ae1400bf2 | 178 | typedef struct |
Vincent Coubard |
638:c90ae1400bf2 | 179 | { |
Vincent Coubard |
638:c90ae1400bf2 | 180 | uint8_t report_id; /**< Non-zero value if there is more than one instance of the same Report Type */ |
Vincent Coubard |
638:c90ae1400bf2 | 181 | uint8_t report_type; /**< Type of Report characteristic (see @ref BLE_HIDS_REPORT_TYPE) */ |
Vincent Coubard |
638:c90ae1400bf2 | 182 | } ble_srv_report_ref_t; |
Vincent Coubard |
638:c90ae1400bf2 | 183 | |
Vincent Coubard |
638:c90ae1400bf2 | 184 | /**@brief UTF-8 string data type. |
Vincent Coubard |
638:c90ae1400bf2 | 185 | * |
Vincent Coubard |
638:c90ae1400bf2 | 186 | * @note The type can only hold a pointer to the string data (i.e. not the actual data). |
Vincent Coubard |
638:c90ae1400bf2 | 187 | */ |
Vincent Coubard |
638:c90ae1400bf2 | 188 | typedef struct |
Vincent Coubard |
638:c90ae1400bf2 | 189 | { |
Vincent Coubard |
638:c90ae1400bf2 | 190 | uint16_t length; /**< String length. */ |
Vincent Coubard |
638:c90ae1400bf2 | 191 | uint8_t * p_str; /**< String data. */ |
Vincent Coubard |
638:c90ae1400bf2 | 192 | } ble_srv_utf8_str_t; |
Vincent Coubard |
638:c90ae1400bf2 | 193 | |
Vincent Coubard |
638:c90ae1400bf2 | 194 | |
Vincent Coubard |
638:c90ae1400bf2 | 195 | /**@brief Security settings structure. |
Vincent Coubard |
638:c90ae1400bf2 | 196 | * @details This structure contains the security options needed during initialization of the |
Vincent Coubard |
638:c90ae1400bf2 | 197 | * service. |
Vincent Coubard |
638:c90ae1400bf2 | 198 | */ |
Vincent Coubard |
638:c90ae1400bf2 | 199 | typedef struct |
Vincent Coubard |
638:c90ae1400bf2 | 200 | { |
Vincent Coubard |
638:c90ae1400bf2 | 201 | ble_gap_conn_sec_mode_t read_perm; /**< Read permissions. */ |
Vincent Coubard |
638:c90ae1400bf2 | 202 | ble_gap_conn_sec_mode_t write_perm; /**< Write permissions. */ |
Vincent Coubard |
638:c90ae1400bf2 | 203 | } ble_srv_security_mode_t; |
Vincent Coubard |
638:c90ae1400bf2 | 204 | |
Vincent Coubard |
638:c90ae1400bf2 | 205 | /**@brief Security settings structure. |
Vincent Coubard |
638:c90ae1400bf2 | 206 | * @details This structure contains the security options needed during initialization of the |
Vincent Coubard |
638:c90ae1400bf2 | 207 | * service. It can be used when the characteristics contains a CCCD. |
Vincent Coubard |
638:c90ae1400bf2 | 208 | */ |
Vincent Coubard |
638:c90ae1400bf2 | 209 | typedef struct |
Vincent Coubard |
638:c90ae1400bf2 | 210 | { |
Vincent Coubard |
638:c90ae1400bf2 | 211 | ble_gap_conn_sec_mode_t cccd_write_perm; /**< Write permissions for Client Characteristic Configuration Descriptor. */ |
Vincent Coubard |
638:c90ae1400bf2 | 212 | ble_gap_conn_sec_mode_t read_perm; /**< Read permissions. */ |
Vincent Coubard |
638:c90ae1400bf2 | 213 | ble_gap_conn_sec_mode_t write_perm; /**< Write permissions. */ |
Vincent Coubard |
638:c90ae1400bf2 | 214 | } ble_srv_cccd_security_mode_t; |
Vincent Coubard |
638:c90ae1400bf2 | 215 | |
Vincent Coubard |
638:c90ae1400bf2 | 216 | /**@brief Function for decoding a CCCD value, and then testing if notification is |
Vincent Coubard |
638:c90ae1400bf2 | 217 | * enabled. |
Vincent Coubard |
638:c90ae1400bf2 | 218 | * |
Vincent Coubard |
638:c90ae1400bf2 | 219 | * @param[in] p_encoded_data Buffer where the encoded CCCD is stored. |
Vincent Coubard |
638:c90ae1400bf2 | 220 | * |
Vincent Coubard |
638:c90ae1400bf2 | 221 | * @retval TRUE If notification is enabled. |
Vincent Coubard |
638:c90ae1400bf2 | 222 | * @retval FALSE Otherwise. |
Vincent Coubard |
638:c90ae1400bf2 | 223 | */ |
Vincent Coubard |
638:c90ae1400bf2 | 224 | static __INLINE bool ble_srv_is_notification_enabled(uint8_t * p_encoded_data) |
Vincent Coubard |
638:c90ae1400bf2 | 225 | { |
Vincent Coubard |
638:c90ae1400bf2 | 226 | uint16_t cccd_value = uint16_decode(p_encoded_data); |
Vincent Coubard |
638:c90ae1400bf2 | 227 | return ((cccd_value & BLE_GATT_HVX_NOTIFICATION) != 0); |
Vincent Coubard |
638:c90ae1400bf2 | 228 | } |
Vincent Coubard |
638:c90ae1400bf2 | 229 | |
Vincent Coubard |
638:c90ae1400bf2 | 230 | /**@brief Function for decoding a CCCD value, and then testing if indication is |
Vincent Coubard |
638:c90ae1400bf2 | 231 | * enabled. |
Vincent Coubard |
638:c90ae1400bf2 | 232 | * |
Vincent Coubard |
638:c90ae1400bf2 | 233 | * @param[in] p_encoded_data Buffer where the encoded CCCD is stored. |
Vincent Coubard |
638:c90ae1400bf2 | 234 | * |
Vincent Coubard |
638:c90ae1400bf2 | 235 | * @retval TRUE If indication is enabled. |
Vincent Coubard |
638:c90ae1400bf2 | 236 | * @retval FALSE Otherwise. |
Vincent Coubard |
638:c90ae1400bf2 | 237 | */ |
Vincent Coubard |
638:c90ae1400bf2 | 238 | static __INLINE bool ble_srv_is_indication_enabled(uint8_t * p_encoded_data) |
Vincent Coubard |
638:c90ae1400bf2 | 239 | { |
Vincent Coubard |
638:c90ae1400bf2 | 240 | uint16_t cccd_value = uint16_decode(p_encoded_data); |
Vincent Coubard |
638:c90ae1400bf2 | 241 | return ((cccd_value & BLE_GATT_HVX_INDICATION) != 0); |
Vincent Coubard |
638:c90ae1400bf2 | 242 | } |
Vincent Coubard |
638:c90ae1400bf2 | 243 | |
Vincent Coubard |
638:c90ae1400bf2 | 244 | /**@brief Function for encoding a Report Reference Descriptor. |
Vincent Coubard |
638:c90ae1400bf2 | 245 | * |
Vincent Coubard |
638:c90ae1400bf2 | 246 | * @param[in] p_encoded_buffer The buffer of the encoded data. |
Vincent Coubard |
638:c90ae1400bf2 | 247 | * @param[in] p_report_ref Report Reference value to be encoded. |
Vincent Coubard |
638:c90ae1400bf2 | 248 | * |
Vincent Coubard |
638:c90ae1400bf2 | 249 | * @return Length of the encoded data. |
Vincent Coubard |
638:c90ae1400bf2 | 250 | */ |
Vincent Coubard |
638:c90ae1400bf2 | 251 | uint8_t ble_srv_report_ref_encode(uint8_t * p_encoded_buffer, |
Vincent Coubard |
638:c90ae1400bf2 | 252 | const ble_srv_report_ref_t * p_report_ref); |
Vincent Coubard |
638:c90ae1400bf2 | 253 | |
Vincent Coubard |
638:c90ae1400bf2 | 254 | /**@brief Function for making a UTF-8 structure refer to an ASCII string. |
Vincent Coubard |
638:c90ae1400bf2 | 255 | * |
Vincent Coubard |
638:c90ae1400bf2 | 256 | * @param[out] p_utf8 UTF-8 structure to be set. |
Vincent Coubard |
638:c90ae1400bf2 | 257 | * @param[in] p_ascii ASCII string to be referred to. |
Vincent Coubard |
638:c90ae1400bf2 | 258 | */ |
Vincent Coubard |
638:c90ae1400bf2 | 259 | void ble_srv_ascii_to_utf8(ble_srv_utf8_str_t * p_utf8, char * p_ascii); |
Vincent Coubard |
638:c90ae1400bf2 | 260 | |
Vincent Coubard |
638:c90ae1400bf2 | 261 | |
Vincent Coubard |
638:c90ae1400bf2 | 262 | /**@brief Security Access enumeration. |
Vincent Coubard |
638:c90ae1400bf2 | 263 | * @details This enumeration gives the possible requirements for accessing a characteristic value. |
Vincent Coubard |
638:c90ae1400bf2 | 264 | */ |
Vincent Coubard |
638:c90ae1400bf2 | 265 | typedef enum |
Vincent Coubard |
638:c90ae1400bf2 | 266 | { |
Vincent Coubard |
638:c90ae1400bf2 | 267 | SEC_NO_ACCESS = 0, /**< Not possible to access. */ |
Vincent Coubard |
638:c90ae1400bf2 | 268 | SEC_OPEN = 1, /**< Access open. */ |
Vincent Coubard |
638:c90ae1400bf2 | 269 | SEC_JUST_WORKS = 2, /**< Access possible with 'Just Works' security at least. */ |
Vincent Coubard |
638:c90ae1400bf2 | 270 | SEC_MITM = 3, /**< Access possible with 'MITM' security at least. */ |
Vincent Coubard |
638:c90ae1400bf2 | 271 | SEC_SIGNED = 4, /**< Access possible with 'signed' security at least. */ |
Vincent Coubard |
638:c90ae1400bf2 | 272 | SEC_SIGNED_MITM = 5 /**< Access possible with 'signed and MITM' security at least. */ |
Vincent Coubard |
638:c90ae1400bf2 | 273 | }security_req_t; |
Vincent Coubard |
638:c90ae1400bf2 | 274 | |
Vincent Coubard |
638:c90ae1400bf2 | 275 | |
Vincent Coubard |
638:c90ae1400bf2 | 276 | /**@brief Characteristic User Descriptor parameters. |
Vincent Coubard |
638:c90ae1400bf2 | 277 | * @details This structure contains the parameters for User Descriptor. |
Vincent Coubard |
638:c90ae1400bf2 | 278 | */ |
Vincent Coubard |
638:c90ae1400bf2 | 279 | typedef struct |
Vincent Coubard |
638:c90ae1400bf2 | 280 | { |
Vincent Coubard |
638:c90ae1400bf2 | 281 | uint16_t max_size; /**< Maximum size of the user descriptor*/ |
Vincent Coubard |
638:c90ae1400bf2 | 282 | uint16_t size; /**< Size of the user descriptor*/ |
Vincent Coubard |
638:c90ae1400bf2 | 283 | uint8_t *p_char_user_desc; /**< User descriptor content, pointer to a UTF-8 encoded string (non-NULL terminated)*/ |
Vincent Coubard |
638:c90ae1400bf2 | 284 | bool is_var_len; /**< Indicates if the user descriptor has variable length.*/ |
Vincent Coubard |
638:c90ae1400bf2 | 285 | ble_gatt_char_props_t char_props; /**< user descriptor properties.*/ |
Vincent Coubard |
638:c90ae1400bf2 | 286 | bool is_defered_read; /**< Indicate if deferred read operations are supported.*/ |
Vincent Coubard |
638:c90ae1400bf2 | 287 | bool is_defered_write; /**< Indicate if deferred write operations are supported.*/ |
Vincent Coubard |
638:c90ae1400bf2 | 288 | security_req_t read_access; /**< Security requirement for reading the user descriptor.*/ |
Vincent Coubard |
638:c90ae1400bf2 | 289 | security_req_t write_access; /**< Security requirement for writing the user descriptor.*/ |
Vincent Coubard |
638:c90ae1400bf2 | 290 | bool is_value_user; /**< Indicate if the content of the characteristic is to be stored in the application (user) or in the stack.*/ |
Vincent Coubard |
638:c90ae1400bf2 | 291 | }ble_add_char_user_desc_t; |
Vincent Coubard |
638:c90ae1400bf2 | 292 | |
Vincent Coubard |
638:c90ae1400bf2 | 293 | |
Vincent Coubard |
638:c90ae1400bf2 | 294 | /**@brief Add characteristic parameters structure. |
Vincent Coubard |
638:c90ae1400bf2 | 295 | * @details This structure contains the parameters needed to use the @ref characteristic_add function. |
Vincent Coubard |
638:c90ae1400bf2 | 296 | */ |
Vincent Coubard |
638:c90ae1400bf2 | 297 | typedef struct |
Vincent Coubard |
638:c90ae1400bf2 | 298 | { |
Vincent Coubard |
638:c90ae1400bf2 | 299 | uint16_t uuid; /**< Characteristic UUID (16 bits UUIDs).*/ |
Vincent Coubard |
638:c90ae1400bf2 | 300 | uint8_t uuid_type; /**< Base UUID. If 0, the Bluetooth SIG UUID will be used. Otherwise, this should be a value returned by @ref sd_ble_uuid_vs_add when adding the base UUID.*/ |
Vincent Coubard |
638:c90ae1400bf2 | 301 | uint16_t max_len; /**< Maximum length of the characteristic value.*/ |
Vincent Coubard |
638:c90ae1400bf2 | 302 | uint16_t init_len; /**< Initial length of the characteristic value.*/ |
Vincent Coubard |
638:c90ae1400bf2 | 303 | uint8_t * p_init_value; /**< Initial encoded value of the characteristic.*/ |
Vincent Coubard |
638:c90ae1400bf2 | 304 | bool is_var_len; /**< Indicates if the characteristic value has variable length.*/ |
Vincent Coubard |
638:c90ae1400bf2 | 305 | ble_gatt_char_props_t char_props; /**< Characteristic properties.*/ |
Vincent Coubard |
638:c90ae1400bf2 | 306 | bool is_defered_read; /**< Indicate if deferred read operations are supported.*/ |
Vincent Coubard |
638:c90ae1400bf2 | 307 | bool is_defered_write; /**< Indicate if deferred write operations are supported.*/ |
Vincent Coubard |
638:c90ae1400bf2 | 308 | security_req_t read_access; /**< Security requirement for reading the characteristic value.*/ |
Vincent Coubard |
638:c90ae1400bf2 | 309 | security_req_t write_access; /**< Security requirement for writing the characteristic value.*/ |
Vincent Coubard |
638:c90ae1400bf2 | 310 | security_req_t cccd_write_access; /**< Security requirement for writing the characteristic's CCCD.*/ |
Vincent Coubard |
638:c90ae1400bf2 | 311 | bool is_value_user; /**< Indicate if the content of the characteristic is to be stored in the application (user) or in the stack.*/ |
Vincent Coubard |
638:c90ae1400bf2 | 312 | ble_add_char_user_desc_t *p_user_descr; /**< Pointer to user descriptor if needed*/ |
Vincent Coubard |
638:c90ae1400bf2 | 313 | ble_gatts_char_pf_t *p_presentation_format; /**< Pointer to characteristic format if needed*/ |
Vincent Coubard |
638:c90ae1400bf2 | 314 | } ble_add_char_params_t; |
Vincent Coubard |
638:c90ae1400bf2 | 315 | |
Vincent Coubard |
638:c90ae1400bf2 | 316 | |
Vincent Coubard |
638:c90ae1400bf2 | 317 | /**@brief Add descriptor parameters structure. |
Vincent Coubard |
638:c90ae1400bf2 | 318 | * @details This structure contains the parameters needed to use the @ref descriptor_add function. |
Vincent Coubard |
638:c90ae1400bf2 | 319 | */ |
Vincent Coubard |
638:c90ae1400bf2 | 320 | typedef struct |
Vincent Coubard |
638:c90ae1400bf2 | 321 | { |
Vincent Coubard |
638:c90ae1400bf2 | 322 | uint16_t uuid; /**< descriptor UUID (16 bits UUIDs).*/ |
Vincent Coubard |
638:c90ae1400bf2 | 323 | uint8_t uuid_type; /**< Base UUID. If 0, the Bluetooth SIG UUID will be used. Otherwise, this should be a value returned by @ref sd_ble_uuid_vs_add when adding the base UUID.*/ |
Vincent Coubard |
638:c90ae1400bf2 | 324 | bool is_defered_read; /**< Indicate if deferred read operations are supported.*/ |
Vincent Coubard |
638:c90ae1400bf2 | 325 | bool is_defered_write; /**< Indicate if deferred write operations are supported.*/ |
Vincent Coubard |
638:c90ae1400bf2 | 326 | bool is_var_len; /**< Indicates if the descriptor value has variable length.*/ |
Vincent Coubard |
638:c90ae1400bf2 | 327 | security_req_t read_access; /**< Security requirement for reading the descriptor value.*/ |
Vincent Coubard |
638:c90ae1400bf2 | 328 | security_req_t write_access; /**< Security requirement for writing the descriptor value.*/ |
Vincent Coubard |
638:c90ae1400bf2 | 329 | bool is_value_user; /**< Indicate if the content of the characteristic is to be stored in the application (user) or in the stack.*/ |
Vincent Coubard |
638:c90ae1400bf2 | 330 | uint16_t init_len; /**< Initial descriptor value length in bytes. */ |
Vincent Coubard |
638:c90ae1400bf2 | 331 | uint16_t init_offs; /**< Initial descriptor value offset in bytes. If different from zero, the first init_offs bytes of the attribute value will be left uninitialized. */ |
Vincent Coubard |
638:c90ae1400bf2 | 332 | uint16_t max_len; /**< Maximum descriptor value length in bytes, see @ref BLE_GATTS_ATTR_LENS_MAX for maximum values. */ |
Vincent Coubard |
638:c90ae1400bf2 | 333 | uint8_t* p_value; /**< Pointer to the value of the descriptor*/ |
Vincent Coubard |
638:c90ae1400bf2 | 334 | } ble_add_descr_params_t; |
Vincent Coubard |
638:c90ae1400bf2 | 335 | |
Vincent Coubard |
638:c90ae1400bf2 | 336 | |
Vincent Coubard |
638:c90ae1400bf2 | 337 | /**@brief Function for adding a characteristic to a given service. |
Vincent Coubard |
638:c90ae1400bf2 | 338 | * |
Vincent Coubard |
638:c90ae1400bf2 | 339 | * If no pointer is given for the initial value, |
Vincent Coubard |
638:c90ae1400bf2 | 340 | * the initial length parameter will be ignored and the initial length will be 0. |
Vincent Coubard |
638:c90ae1400bf2 | 341 | * |
Vincent Coubard |
638:c90ae1400bf2 | 342 | * @param[in] service_handle Handle of the service to which the characteristic is to be added. |
Vincent Coubard |
638:c90ae1400bf2 | 343 | * @param[in] p_char_props Information needed to add the characteristic. |
Vincent Coubard |
638:c90ae1400bf2 | 344 | * @param[out] p_char_handle Handle of the added characteristic. |
Vincent Coubard |
638:c90ae1400bf2 | 345 | * |
Vincent Coubard |
638:c90ae1400bf2 | 346 | * @retval NRF_SUCCESS If the characteristic was added successfully. Otherwise, an error code is returned. |
Vincent Coubard |
638:c90ae1400bf2 | 347 | */ |
Vincent Coubard |
638:c90ae1400bf2 | 348 | uint32_t characteristic_add(uint16_t service_handle, |
Vincent Coubard |
638:c90ae1400bf2 | 349 | ble_add_char_params_t * p_char_props, |
Vincent Coubard |
638:c90ae1400bf2 | 350 | ble_gatts_char_handles_t * p_char_handle); |
Vincent Coubard |
638:c90ae1400bf2 | 351 | |
Vincent Coubard |
638:c90ae1400bf2 | 352 | |
Vincent Coubard |
638:c90ae1400bf2 | 353 | /**@brief Function for adding a characteristic's descriptor to a given characteristic. |
Vincent Coubard |
638:c90ae1400bf2 | 354 | * |
Vincent Coubard |
638:c90ae1400bf2 | 355 | * @param[in] char_handle Handle of the characteristic to which the descriptor is to be added, if @ref BLE_GATT_HANDLE_INVALID is used, it will be placed sequentially. |
Vincent Coubard |
638:c90ae1400bf2 | 356 | * @param[in] p_descr_props Information needed to add the descriptor. |
Vincent Coubard |
638:c90ae1400bf2 | 357 | * @param[out] p_descr_handle Handle of the added descriptor. |
Vincent Coubard |
638:c90ae1400bf2 | 358 | * |
Vincent Coubard |
638:c90ae1400bf2 | 359 | * @retval NRF_SUCCESS If the characteristic was added successfully. Otherwise, an error code is returned. |
Vincent Coubard |
638:c90ae1400bf2 | 360 | */ |
Vincent Coubard |
638:c90ae1400bf2 | 361 | uint32_t descriptor_add(uint16_t char_handle, |
Vincent Coubard |
638:c90ae1400bf2 | 362 | ble_add_descr_params_t * p_descr_props, |
Vincent Coubard |
638:c90ae1400bf2 | 363 | uint16_t * p_descr_handle); |
Vincent Coubard |
638:c90ae1400bf2 | 364 | |
Vincent Coubard |
638:c90ae1400bf2 | 365 | |
Vincent Coubard |
638:c90ae1400bf2 | 366 | #endif // BLE_SRV_COMMON_H__ |
Vincent Coubard |
638:c90ae1400bf2 | 367 | |
Vincent Coubard |
638:c90ae1400bf2 | 368 | /** @} */ |