Mouse code for the MacroRat

Dependencies:   ITG3200 QEI

Committer:
sahilmgandhi
Date:
Sun May 14 23:18:57 2017 +0000
Revision:
18:6a4db94011d3
Publishing again

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sahilmgandhi 18:6a4db94011d3 1 /*
sahilmgandhi 18:6a4db94011d3 2 * Copyright (c) 2000 Nordic Semiconductor ASA
sahilmgandhi 18:6a4db94011d3 3 * All rights reserved.
sahilmgandhi 18:6a4db94011d3 4 *
sahilmgandhi 18:6a4db94011d3 5 * Redistribution and use in source and binary forms, with or without modification,
sahilmgandhi 18:6a4db94011d3 6 * are permitted provided that the following conditions are met:
sahilmgandhi 18:6a4db94011d3 7 *
sahilmgandhi 18:6a4db94011d3 8 * 1. Redistributions of source code must retain the above copyright notice, this list
sahilmgandhi 18:6a4db94011d3 9 * of conditions and the following disclaimer.
sahilmgandhi 18:6a4db94011d3 10 *
sahilmgandhi 18:6a4db94011d3 11 * 2. Redistributions in binary form, except as embedded into a Nordic Semiconductor ASA
sahilmgandhi 18:6a4db94011d3 12 * integrated circuit in a product or a software update for such product, must reproduce
sahilmgandhi 18:6a4db94011d3 13 * the above copyright notice, this list of conditions and the following disclaimer in
sahilmgandhi 18:6a4db94011d3 14 * the documentation and/or other materials provided with the distribution.
sahilmgandhi 18:6a4db94011d3 15 *
sahilmgandhi 18:6a4db94011d3 16 * 3. Neither the name of Nordic Semiconductor ASA nor the names of its contributors may be
sahilmgandhi 18:6a4db94011d3 17 * used to endorse or promote products derived from this software without specific prior
sahilmgandhi 18:6a4db94011d3 18 * written permission.
sahilmgandhi 18:6a4db94011d3 19 *
sahilmgandhi 18:6a4db94011d3 20 * 4. This software, with or without modification, must only be used with a
sahilmgandhi 18:6a4db94011d3 21 * Nordic Semiconductor ASA integrated circuit.
sahilmgandhi 18:6a4db94011d3 22 *
sahilmgandhi 18:6a4db94011d3 23 * 5. Any software provided in binary or object form under this license must not be reverse
sahilmgandhi 18:6a4db94011d3 24 * engineered, decompiled, modified and/or disassembled.
sahilmgandhi 18:6a4db94011d3 25 *
sahilmgandhi 18:6a4db94011d3 26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
sahilmgandhi 18:6a4db94011d3 27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
sahilmgandhi 18:6a4db94011d3 28 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
sahilmgandhi 18:6a4db94011d3 29 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
sahilmgandhi 18:6a4db94011d3 30 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
sahilmgandhi 18:6a4db94011d3 31 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
sahilmgandhi 18:6a4db94011d3 32 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
sahilmgandhi 18:6a4db94011d3 33 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
sahilmgandhi 18:6a4db94011d3 34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
sahilmgandhi 18:6a4db94011d3 35 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
sahilmgandhi 18:6a4db94011d3 36 *
sahilmgandhi 18:6a4db94011d3 37 */
sahilmgandhi 18:6a4db94011d3 38
sahilmgandhi 18:6a4db94011d3 39
sahilmgandhi 18:6a4db94011d3 40 /**
sahilmgandhi 18:6a4db94011d3 41 @addtogroup BLE_GATTC Generic Attribute Profile (GATT) Client
sahilmgandhi 18:6a4db94011d3 42 @{
sahilmgandhi 18:6a4db94011d3 43 @brief Definitions and prototypes for the GATT Client interface.
sahilmgandhi 18:6a4db94011d3 44 */
sahilmgandhi 18:6a4db94011d3 45
sahilmgandhi 18:6a4db94011d3 46 #ifndef NRF_BLE_GATTC_H__
sahilmgandhi 18:6a4db94011d3 47 #define NRF_BLE_GATTC_H__
sahilmgandhi 18:6a4db94011d3 48
sahilmgandhi 18:6a4db94011d3 49 #include "nrf_ble_gatt.h"
sahilmgandhi 18:6a4db94011d3 50 #include "nrf_ble_types.h"
sahilmgandhi 18:6a4db94011d3 51 #include "nrf_ble_ranges.h"
sahilmgandhi 18:6a4db94011d3 52 #include "nrf_svc.h"
sahilmgandhi 18:6a4db94011d3 53
sahilmgandhi 18:6a4db94011d3 54 #ifdef __cplusplus
sahilmgandhi 18:6a4db94011d3 55 extern "C" {
sahilmgandhi 18:6a4db94011d3 56 #endif
sahilmgandhi 18:6a4db94011d3 57
sahilmgandhi 18:6a4db94011d3 58 /** @addtogroup BLE_GATTC_ENUMERATIONS Enumerations
sahilmgandhi 18:6a4db94011d3 59 * @{ */
sahilmgandhi 18:6a4db94011d3 60
sahilmgandhi 18:6a4db94011d3 61 /**@brief GATTC API SVC numbers. */
sahilmgandhi 18:6a4db94011d3 62 enum BLE_GATTC_SVCS
sahilmgandhi 18:6a4db94011d3 63 {
sahilmgandhi 18:6a4db94011d3 64 SD_BLE_GATTC_PRIMARY_SERVICES_DISCOVER = BLE_GATTC_SVC_BASE, /**< Primary Service Discovery. */
sahilmgandhi 18:6a4db94011d3 65 SD_BLE_GATTC_RELATIONSHIPS_DISCOVER, /**< Relationship Discovery. */
sahilmgandhi 18:6a4db94011d3 66 SD_BLE_GATTC_CHARACTERISTICS_DISCOVER, /**< Characteristic Discovery. */
sahilmgandhi 18:6a4db94011d3 67 SD_BLE_GATTC_DESCRIPTORS_DISCOVER, /**< Characteristic Descriptor Discovery. */
sahilmgandhi 18:6a4db94011d3 68 SD_BLE_GATTC_ATTR_INFO_DISCOVER, /**< Attribute Information Discovery. */
sahilmgandhi 18:6a4db94011d3 69 SD_BLE_GATTC_CHAR_VALUE_BY_UUID_READ, /**< Read Characteristic Value by UUID. */
sahilmgandhi 18:6a4db94011d3 70 SD_BLE_GATTC_READ, /**< Generic read. */
sahilmgandhi 18:6a4db94011d3 71 SD_BLE_GATTC_CHAR_VALUES_READ, /**< Read multiple Characteristic Values. */
sahilmgandhi 18:6a4db94011d3 72 SD_BLE_GATTC_WRITE, /**< Generic write. */
sahilmgandhi 18:6a4db94011d3 73 SD_BLE_GATTC_HV_CONFIRM, /**< Handle Value Confirmation. */
sahilmgandhi 18:6a4db94011d3 74 };
sahilmgandhi 18:6a4db94011d3 75
sahilmgandhi 18:6a4db94011d3 76 /**
sahilmgandhi 18:6a4db94011d3 77 * @brief GATT Client Event IDs.
sahilmgandhi 18:6a4db94011d3 78 */
sahilmgandhi 18:6a4db94011d3 79 enum BLE_GATTC_EVTS
sahilmgandhi 18:6a4db94011d3 80 {
sahilmgandhi 18:6a4db94011d3 81 BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP = BLE_GATTC_EVT_BASE, /**< Primary Service Discovery Response event. \n See @ref ble_gattc_evt_prim_srvc_disc_rsp_t. */
sahilmgandhi 18:6a4db94011d3 82 BLE_GATTC_EVT_REL_DISC_RSP, /**< Relationship Discovery Response event. \n See @ref ble_gattc_evt_rel_disc_rsp_t. */
sahilmgandhi 18:6a4db94011d3 83 BLE_GATTC_EVT_CHAR_DISC_RSP, /**< Characteristic Discovery Response event. \n See @ref ble_gattc_evt_char_disc_rsp_t. */
sahilmgandhi 18:6a4db94011d3 84 BLE_GATTC_EVT_DESC_DISC_RSP, /**< Descriptor Discovery Response event. \n See @ref ble_gattc_evt_desc_disc_rsp_t. */
sahilmgandhi 18:6a4db94011d3 85 BLE_GATTC_EVT_ATTR_INFO_DISC_RSP, /**< Attribute Information Response event. \n See @ref ble_gattc_evt_attr_info_disc_rsp_t. */
sahilmgandhi 18:6a4db94011d3 86 BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP, /**< Read By UUID Response event. \n See @ref ble_gattc_evt_char_val_by_uuid_read_rsp_t. */
sahilmgandhi 18:6a4db94011d3 87 BLE_GATTC_EVT_READ_RSP, /**< Read Response event. \n See @ref ble_gattc_evt_read_rsp_t. */
sahilmgandhi 18:6a4db94011d3 88 BLE_GATTC_EVT_CHAR_VALS_READ_RSP, /**< Read multiple Response event. \n See @ref ble_gattc_evt_char_vals_read_rsp_t. */
sahilmgandhi 18:6a4db94011d3 89 BLE_GATTC_EVT_WRITE_RSP, /**< Write Response event. \n See @ref ble_gattc_evt_write_rsp_t. */
sahilmgandhi 18:6a4db94011d3 90 BLE_GATTC_EVT_HVX, /**< Handle Value Notification or Indication event. \n Confirm indication with @ref sd_ble_gattc_hv_confirm. \n See @ref ble_gattc_evt_hvx_t. */
sahilmgandhi 18:6a4db94011d3 91 BLE_GATTC_EVT_TIMEOUT /**< Timeout event. \n See @ref ble_gattc_evt_timeout_t. */
sahilmgandhi 18:6a4db94011d3 92 };
sahilmgandhi 18:6a4db94011d3 93
sahilmgandhi 18:6a4db94011d3 94 /** @} */
sahilmgandhi 18:6a4db94011d3 95
sahilmgandhi 18:6a4db94011d3 96 /** @addtogroup BLE_GATTC_DEFINES Defines
sahilmgandhi 18:6a4db94011d3 97 * @{ */
sahilmgandhi 18:6a4db94011d3 98
sahilmgandhi 18:6a4db94011d3 99 /** @defgroup BLE_ERRORS_GATTC SVC return values specific to GATTC
sahilmgandhi 18:6a4db94011d3 100 * @{ */
sahilmgandhi 18:6a4db94011d3 101 #define BLE_ERROR_GATTC_PROC_NOT_PERMITTED (NRF_GATTC_ERR_BASE + 0x000) /**< Procedure not Permitted. */
sahilmgandhi 18:6a4db94011d3 102 /** @} */
sahilmgandhi 18:6a4db94011d3 103
sahilmgandhi 18:6a4db94011d3 104 /** @defgroup BLE_GATTC_ATTR_INFO_FORMAT Attribute Information Formats
sahilmgandhi 18:6a4db94011d3 105 * @{ */
sahilmgandhi 18:6a4db94011d3 106 #define BLE_GATTC_ATTR_INFO_FORMAT_16BIT 1 /**< 16-bit Attribute Information Format. */
sahilmgandhi 18:6a4db94011d3 107 #define BLE_GATTC_ATTR_INFO_FORMAT_128BIT 2 /**< 128-bit Attribute Information Format. */
sahilmgandhi 18:6a4db94011d3 108 /** @} */
sahilmgandhi 18:6a4db94011d3 109
sahilmgandhi 18:6a4db94011d3 110 /** @} */
sahilmgandhi 18:6a4db94011d3 111
sahilmgandhi 18:6a4db94011d3 112 /** @addtogroup BLE_GATTC_STRUCTURES Structures
sahilmgandhi 18:6a4db94011d3 113 * @{ */
sahilmgandhi 18:6a4db94011d3 114
sahilmgandhi 18:6a4db94011d3 115 /**@brief Operation Handle Range. */
sahilmgandhi 18:6a4db94011d3 116 typedef struct
sahilmgandhi 18:6a4db94011d3 117 {
sahilmgandhi 18:6a4db94011d3 118 uint16_t start_handle; /**< Start Handle. */
sahilmgandhi 18:6a4db94011d3 119 uint16_t end_handle; /**< End Handle. */
sahilmgandhi 18:6a4db94011d3 120 } ble_gattc_handle_range_t;
sahilmgandhi 18:6a4db94011d3 121
sahilmgandhi 18:6a4db94011d3 122
sahilmgandhi 18:6a4db94011d3 123 /**@brief GATT service. */
sahilmgandhi 18:6a4db94011d3 124 typedef struct
sahilmgandhi 18:6a4db94011d3 125 {
sahilmgandhi 18:6a4db94011d3 126 ble_uuid_t uuid; /**< Service UUID. */
sahilmgandhi 18:6a4db94011d3 127 ble_gattc_handle_range_t handle_range; /**< Service Handle Range. */
sahilmgandhi 18:6a4db94011d3 128 } ble_gattc_service_t;
sahilmgandhi 18:6a4db94011d3 129
sahilmgandhi 18:6a4db94011d3 130
sahilmgandhi 18:6a4db94011d3 131 /**@brief GATT include. */
sahilmgandhi 18:6a4db94011d3 132 typedef struct
sahilmgandhi 18:6a4db94011d3 133 {
sahilmgandhi 18:6a4db94011d3 134 uint16_t handle; /**< Include Handle. */
sahilmgandhi 18:6a4db94011d3 135 ble_gattc_service_t included_srvc; /**< Handle of the included service. */
sahilmgandhi 18:6a4db94011d3 136 } ble_gattc_include_t;
sahilmgandhi 18:6a4db94011d3 137
sahilmgandhi 18:6a4db94011d3 138
sahilmgandhi 18:6a4db94011d3 139 /**@brief GATT characteristic. */
sahilmgandhi 18:6a4db94011d3 140 typedef struct
sahilmgandhi 18:6a4db94011d3 141 {
sahilmgandhi 18:6a4db94011d3 142 ble_uuid_t uuid; /**< Characteristic UUID. */
sahilmgandhi 18:6a4db94011d3 143 ble_gatt_char_props_t char_props; /**< Characteristic Properties. */
sahilmgandhi 18:6a4db94011d3 144 uint8_t char_ext_props : 1; /**< Extended properties present. */
sahilmgandhi 18:6a4db94011d3 145 uint16_t handle_decl; /**< Handle of the Characteristic Declaration. */
sahilmgandhi 18:6a4db94011d3 146 uint16_t handle_value; /**< Handle of the Characteristic Value. */
sahilmgandhi 18:6a4db94011d3 147 } ble_gattc_char_t;
sahilmgandhi 18:6a4db94011d3 148
sahilmgandhi 18:6a4db94011d3 149
sahilmgandhi 18:6a4db94011d3 150 /**@brief GATT descriptor. */
sahilmgandhi 18:6a4db94011d3 151 typedef struct
sahilmgandhi 18:6a4db94011d3 152 {
sahilmgandhi 18:6a4db94011d3 153 uint16_t handle; /**< Descriptor Handle. */
sahilmgandhi 18:6a4db94011d3 154 ble_uuid_t uuid; /**< Descriptor UUID. */
sahilmgandhi 18:6a4db94011d3 155 } ble_gattc_desc_t;
sahilmgandhi 18:6a4db94011d3 156
sahilmgandhi 18:6a4db94011d3 157
sahilmgandhi 18:6a4db94011d3 158 /**@brief Write Parameters. */
sahilmgandhi 18:6a4db94011d3 159 typedef struct
sahilmgandhi 18:6a4db94011d3 160 {
sahilmgandhi 18:6a4db94011d3 161 uint8_t write_op; /**< Write Operation to be performed, see @ref BLE_GATT_WRITE_OPS. */
sahilmgandhi 18:6a4db94011d3 162 uint8_t flags; /**< Flags, see @ref BLE_GATT_EXEC_WRITE_FLAGS. */
sahilmgandhi 18:6a4db94011d3 163 uint16_t handle; /**< Handle to the attribute to be written. */
sahilmgandhi 18:6a4db94011d3 164 uint16_t offset; /**< Offset in bytes. @note For WRITE_CMD and WRITE_REQ, offset must be 0. */
sahilmgandhi 18:6a4db94011d3 165 uint16_t len; /**< Length of data in bytes. */
sahilmgandhi 18:6a4db94011d3 166 uint8_t *p_value; /**< Pointer to the value data. */
sahilmgandhi 18:6a4db94011d3 167 } ble_gattc_write_params_t;
sahilmgandhi 18:6a4db94011d3 168
sahilmgandhi 18:6a4db94011d3 169 /**@brief Attribute Information. */
sahilmgandhi 18:6a4db94011d3 170 typedef struct
sahilmgandhi 18:6a4db94011d3 171 {
sahilmgandhi 18:6a4db94011d3 172 uint16_t handle; /**< Attribute handle. */
sahilmgandhi 18:6a4db94011d3 173 union {
sahilmgandhi 18:6a4db94011d3 174 ble_uuid_t uuid16; /**< 16-bit Attribute UUID. */
sahilmgandhi 18:6a4db94011d3 175 ble_uuid128_t uuid128; /**< 128-bit Attribute UUID. */
sahilmgandhi 18:6a4db94011d3 176 } info;
sahilmgandhi 18:6a4db94011d3 177 } ble_gattc_attr_info_t;
sahilmgandhi 18:6a4db94011d3 178
sahilmgandhi 18:6a4db94011d3 179 /**@brief Event structure for @ref BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP. */
sahilmgandhi 18:6a4db94011d3 180 typedef struct
sahilmgandhi 18:6a4db94011d3 181 {
sahilmgandhi 18:6a4db94011d3 182 uint16_t count; /**< Service count. */
sahilmgandhi 18:6a4db94011d3 183 ble_gattc_service_t services[1]; /**< Service data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation.
sahilmgandhi 18:6a4db94011d3 184 See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */
sahilmgandhi 18:6a4db94011d3 185 } ble_gattc_evt_prim_srvc_disc_rsp_t;
sahilmgandhi 18:6a4db94011d3 186
sahilmgandhi 18:6a4db94011d3 187 /**@brief Event structure for @ref BLE_GATTC_EVT_REL_DISC_RSP. */
sahilmgandhi 18:6a4db94011d3 188 typedef struct
sahilmgandhi 18:6a4db94011d3 189 {
sahilmgandhi 18:6a4db94011d3 190 uint16_t count; /**< Include count. */
sahilmgandhi 18:6a4db94011d3 191 ble_gattc_include_t includes[1]; /**< Include data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation.
sahilmgandhi 18:6a4db94011d3 192 See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */
sahilmgandhi 18:6a4db94011d3 193 } ble_gattc_evt_rel_disc_rsp_t;
sahilmgandhi 18:6a4db94011d3 194
sahilmgandhi 18:6a4db94011d3 195 /**@brief Event structure for @ref BLE_GATTC_EVT_CHAR_DISC_RSP. */
sahilmgandhi 18:6a4db94011d3 196 typedef struct
sahilmgandhi 18:6a4db94011d3 197 {
sahilmgandhi 18:6a4db94011d3 198 uint16_t count; /**< Characteristic count. */
sahilmgandhi 18:6a4db94011d3 199 ble_gattc_char_t chars[1]; /**< Characteristic data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation.
sahilmgandhi 18:6a4db94011d3 200 See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */
sahilmgandhi 18:6a4db94011d3 201 } ble_gattc_evt_char_disc_rsp_t;
sahilmgandhi 18:6a4db94011d3 202
sahilmgandhi 18:6a4db94011d3 203 /**@brief Event structure for @ref BLE_GATTC_EVT_DESC_DISC_RSP. */
sahilmgandhi 18:6a4db94011d3 204 typedef struct
sahilmgandhi 18:6a4db94011d3 205 {
sahilmgandhi 18:6a4db94011d3 206 uint16_t count; /**< Descriptor count. */
sahilmgandhi 18:6a4db94011d3 207 ble_gattc_desc_t descs[1]; /**< Descriptor data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation.
sahilmgandhi 18:6a4db94011d3 208 See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */
sahilmgandhi 18:6a4db94011d3 209 } ble_gattc_evt_desc_disc_rsp_t;
sahilmgandhi 18:6a4db94011d3 210
sahilmgandhi 18:6a4db94011d3 211 /**@brief Event structure for @ref BLE_GATTC_EVT_ATTR_INFO_DISC_RSP. */
sahilmgandhi 18:6a4db94011d3 212 typedef struct
sahilmgandhi 18:6a4db94011d3 213 {
sahilmgandhi 18:6a4db94011d3 214 uint16_t count; /**< Attribute count. */
sahilmgandhi 18:6a4db94011d3 215 uint8_t format; /**< Attribute information format, see @ref BLE_GATTC_ATTR_INFO_FORMAT. */
sahilmgandhi 18:6a4db94011d3 216 ble_gattc_attr_info_t attr_info[1]; /**< Attribute information. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation.
sahilmgandhi 18:6a4db94011d3 217 See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */
sahilmgandhi 18:6a4db94011d3 218 } ble_gattc_evt_attr_info_disc_rsp_t;
sahilmgandhi 18:6a4db94011d3 219
sahilmgandhi 18:6a4db94011d3 220 /**@brief GATT read by UUID handle value pair. */
sahilmgandhi 18:6a4db94011d3 221 typedef struct
sahilmgandhi 18:6a4db94011d3 222 {
sahilmgandhi 18:6a4db94011d3 223 uint16_t handle; /**< Attribute Handle. */
sahilmgandhi 18:6a4db94011d3 224 uint8_t *p_value; /**< Pointer to value, variable length (length available as value_len in @ref ble_gattc_evt_char_val_by_uuid_read_rsp_t).
sahilmgandhi 18:6a4db94011d3 225 Please note that this pointer is absolute to the memory provided by the user when retrieving the event,
sahilmgandhi 18:6a4db94011d3 226 so it will effectively point to a location inside the handle_value array. */
sahilmgandhi 18:6a4db94011d3 227 } ble_gattc_handle_value_t;
sahilmgandhi 18:6a4db94011d3 228
sahilmgandhi 18:6a4db94011d3 229 /**@brief Event structure for @ref BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP. */
sahilmgandhi 18:6a4db94011d3 230 typedef struct
sahilmgandhi 18:6a4db94011d3 231 {
sahilmgandhi 18:6a4db94011d3 232 uint16_t count; /**< Handle-Value Pair Count. */
sahilmgandhi 18:6a4db94011d3 233 uint16_t value_len; /**< Length of the value in Handle-Value(s) list. */
sahilmgandhi 18:6a4db94011d3 234 ble_gattc_handle_value_t handle_value[1]; /**< Handle-Value(s) list. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation.
sahilmgandhi 18:6a4db94011d3 235 See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */
sahilmgandhi 18:6a4db94011d3 236 } ble_gattc_evt_char_val_by_uuid_read_rsp_t;
sahilmgandhi 18:6a4db94011d3 237
sahilmgandhi 18:6a4db94011d3 238 /**@brief Event structure for @ref BLE_GATTC_EVT_READ_RSP. */
sahilmgandhi 18:6a4db94011d3 239 typedef struct
sahilmgandhi 18:6a4db94011d3 240 {
sahilmgandhi 18:6a4db94011d3 241 uint16_t handle; /**< Attribute Handle. */
sahilmgandhi 18:6a4db94011d3 242 uint16_t offset; /**< Offset of the attribute data. */
sahilmgandhi 18:6a4db94011d3 243 uint16_t len; /**< Attribute data length. */
sahilmgandhi 18:6a4db94011d3 244 uint8_t data[1]; /**< Attribute data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation.
sahilmgandhi 18:6a4db94011d3 245 See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */
sahilmgandhi 18:6a4db94011d3 246 } ble_gattc_evt_read_rsp_t;
sahilmgandhi 18:6a4db94011d3 247
sahilmgandhi 18:6a4db94011d3 248 /**@brief Event structure for @ref BLE_GATTC_EVT_CHAR_VALS_READ_RSP. */
sahilmgandhi 18:6a4db94011d3 249 typedef struct
sahilmgandhi 18:6a4db94011d3 250 {
sahilmgandhi 18:6a4db94011d3 251 uint16_t len; /**< Concatenated Attribute values length. */
sahilmgandhi 18:6a4db94011d3 252 uint8_t values[1]; /**< Attribute values. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation.
sahilmgandhi 18:6a4db94011d3 253 See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */
sahilmgandhi 18:6a4db94011d3 254 } ble_gattc_evt_char_vals_read_rsp_t;
sahilmgandhi 18:6a4db94011d3 255
sahilmgandhi 18:6a4db94011d3 256 /**@brief Event structure for @ref BLE_GATTC_EVT_WRITE_RSP. */
sahilmgandhi 18:6a4db94011d3 257 typedef struct
sahilmgandhi 18:6a4db94011d3 258 {
sahilmgandhi 18:6a4db94011d3 259 uint16_t handle; /**< Attribute Handle. */
sahilmgandhi 18:6a4db94011d3 260 uint8_t write_op; /**< Type of write operation, see @ref BLE_GATT_WRITE_OPS. */
sahilmgandhi 18:6a4db94011d3 261 uint16_t offset; /**< Data offset. */
sahilmgandhi 18:6a4db94011d3 262 uint16_t len; /**< Data length. */
sahilmgandhi 18:6a4db94011d3 263 uint8_t data[1]; /**< Data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation.
sahilmgandhi 18:6a4db94011d3 264 See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */
sahilmgandhi 18:6a4db94011d3 265 } ble_gattc_evt_write_rsp_t;
sahilmgandhi 18:6a4db94011d3 266
sahilmgandhi 18:6a4db94011d3 267 /**@brief Event structure for @ref BLE_GATTC_EVT_HVX. */
sahilmgandhi 18:6a4db94011d3 268 typedef struct
sahilmgandhi 18:6a4db94011d3 269 {
sahilmgandhi 18:6a4db94011d3 270 uint16_t handle; /**< Handle to which the HVx operation applies. */
sahilmgandhi 18:6a4db94011d3 271 uint8_t type; /**< Indication or Notification, see @ref BLE_GATT_HVX_TYPES. */
sahilmgandhi 18:6a4db94011d3 272 uint16_t len; /**< Attribute data length. */
sahilmgandhi 18:6a4db94011d3 273 uint8_t data[1]; /**< Attribute data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation.
sahilmgandhi 18:6a4db94011d3 274 See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */
sahilmgandhi 18:6a4db94011d3 275 } ble_gattc_evt_hvx_t;
sahilmgandhi 18:6a4db94011d3 276
sahilmgandhi 18:6a4db94011d3 277 /**@brief Event structure for @ref BLE_GATTC_EVT_TIMEOUT. */
sahilmgandhi 18:6a4db94011d3 278 typedef struct
sahilmgandhi 18:6a4db94011d3 279 {
sahilmgandhi 18:6a4db94011d3 280 uint8_t src; /**< Timeout source, see @ref BLE_GATT_TIMEOUT_SOURCES. */
sahilmgandhi 18:6a4db94011d3 281 } ble_gattc_evt_timeout_t;
sahilmgandhi 18:6a4db94011d3 282
sahilmgandhi 18:6a4db94011d3 283 /**@brief GATTC event structure. */
sahilmgandhi 18:6a4db94011d3 284 typedef struct
sahilmgandhi 18:6a4db94011d3 285 {
sahilmgandhi 18:6a4db94011d3 286 uint16_t conn_handle; /**< Connection Handle on which event occured. */
sahilmgandhi 18:6a4db94011d3 287 uint16_t gatt_status; /**< GATT status code for the operation, see @ref BLE_GATT_STATUS_CODES. */
sahilmgandhi 18:6a4db94011d3 288 uint16_t error_handle; /**< In case of error: The handle causing the error. In all other cases @ref BLE_GATT_HANDLE_INVALID. */
sahilmgandhi 18:6a4db94011d3 289 union
sahilmgandhi 18:6a4db94011d3 290 {
sahilmgandhi 18:6a4db94011d3 291 ble_gattc_evt_prim_srvc_disc_rsp_t prim_srvc_disc_rsp; /**< Primary Service Discovery Response Event Parameters. */
sahilmgandhi 18:6a4db94011d3 292 ble_gattc_evt_rel_disc_rsp_t rel_disc_rsp; /**< Relationship Discovery Response Event Parameters. */
sahilmgandhi 18:6a4db94011d3 293 ble_gattc_evt_char_disc_rsp_t char_disc_rsp; /**< Characteristic Discovery Response Event Parameters. */
sahilmgandhi 18:6a4db94011d3 294 ble_gattc_evt_desc_disc_rsp_t desc_disc_rsp; /**< Descriptor Discovery Response Event Parameters. */
sahilmgandhi 18:6a4db94011d3 295 ble_gattc_evt_char_val_by_uuid_read_rsp_t char_val_by_uuid_read_rsp; /**< Characteristic Value Read by UUID Response Event Parameters. */
sahilmgandhi 18:6a4db94011d3 296 ble_gattc_evt_read_rsp_t read_rsp; /**< Read Response Event Parameters. */
sahilmgandhi 18:6a4db94011d3 297 ble_gattc_evt_char_vals_read_rsp_t char_vals_read_rsp; /**< Characteristic Values Read Response Event Parameters. */
sahilmgandhi 18:6a4db94011d3 298 ble_gattc_evt_write_rsp_t write_rsp; /**< Write Response Event Parameters. */
sahilmgandhi 18:6a4db94011d3 299 ble_gattc_evt_hvx_t hvx; /**< Handle Value Notification/Indication Event Parameters. */
sahilmgandhi 18:6a4db94011d3 300 ble_gattc_evt_timeout_t timeout; /**< Timeout Event Parameters. */
sahilmgandhi 18:6a4db94011d3 301 ble_gattc_evt_attr_info_disc_rsp_t attr_info_disc_rsp; /**< Attribute Information Discovery Event Parameters. */
sahilmgandhi 18:6a4db94011d3 302 } params; /**< Event Parameters. @note Only valid if @ref gatt_status == @ref BLE_GATT_STATUS_SUCCESS. */
sahilmgandhi 18:6a4db94011d3 303 } ble_gattc_evt_t;
sahilmgandhi 18:6a4db94011d3 304 /** @} */
sahilmgandhi 18:6a4db94011d3 305
sahilmgandhi 18:6a4db94011d3 306 /** @addtogroup BLE_GATTC_FUNCTIONS Functions
sahilmgandhi 18:6a4db94011d3 307 * @{ */
sahilmgandhi 18:6a4db94011d3 308
sahilmgandhi 18:6a4db94011d3 309 /**@brief Initiate or continue a GATT Primary Service Discovery procedure.
sahilmgandhi 18:6a4db94011d3 310 *
sahilmgandhi 18:6a4db94011d3 311 * @details This function initiates or resumes a Primary Service discovery procedure, starting from the supplied handle.
sahilmgandhi 18:6a4db94011d3 312 * If the last service has not been reached, this function must be called again with an updated start handle value to continue the search.
sahilmgandhi 18:6a4db94011d3 313 *
sahilmgandhi 18:6a4db94011d3 314 * @note If any of the discovered services have 128-bit UUIDs which are not present in the table provided to ble_vs_uuids_assign, a UUID structure with
sahilmgandhi 18:6a4db94011d3 315 * type @ref BLE_UUID_TYPE_UNKNOWN will be received in the corresponding event.
sahilmgandhi 18:6a4db94011d3 316 *
sahilmgandhi 18:6a4db94011d3 317 * @events
sahilmgandhi 18:6a4db94011d3 318 * @event{@ref BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP}
sahilmgandhi 18:6a4db94011d3 319 * @endevents
sahilmgandhi 18:6a4db94011d3 320 *
sahilmgandhi 18:6a4db94011d3 321 * @mscs
sahilmgandhi 18:6a4db94011d3 322 * @mmsc{@ref BLE_GATTC_PRIM_SRVC_DISC_MSC}
sahilmgandhi 18:6a4db94011d3 323 * @endmscs
sahilmgandhi 18:6a4db94011d3 324 *
sahilmgandhi 18:6a4db94011d3 325 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
sahilmgandhi 18:6a4db94011d3 326 * @param[in] start_handle Handle to start searching from.
sahilmgandhi 18:6a4db94011d3 327 * @param[in] p_srvc_uuid Pointer to the service UUID to be found. If it is NULL, all primary services will be returned.
sahilmgandhi 18:6a4db94011d3 328 *
sahilmgandhi 18:6a4db94011d3 329 * @retval ::NRF_SUCCESS Successfully started or resumed the Primary Service Discovery procedure.
sahilmgandhi 18:6a4db94011d3 330 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
sahilmgandhi 18:6a4db94011d3 331 * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State.
sahilmgandhi 18:6a4db94011d3 332 * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
sahilmgandhi 18:6a4db94011d3 333 * @retval ::NRF_ERROR_BUSY Client procedure already in progress.
sahilmgandhi 18:6a4db94011d3 334 */
sahilmgandhi 18:6a4db94011d3 335 SVCALL(SD_BLE_GATTC_PRIMARY_SERVICES_DISCOVER, uint32_t, sd_ble_gattc_primary_services_discover(uint16_t conn_handle, uint16_t start_handle, ble_uuid_t const *p_srvc_uuid));
sahilmgandhi 18:6a4db94011d3 336
sahilmgandhi 18:6a4db94011d3 337
sahilmgandhi 18:6a4db94011d3 338 /**@brief Initiate or continue a GATT Relationship Discovery procedure.
sahilmgandhi 18:6a4db94011d3 339 *
sahilmgandhi 18:6a4db94011d3 340 * @details This function initiates or resumes the Find Included Services sub-procedure. If the last included service has not been reached,
sahilmgandhi 18:6a4db94011d3 341 * this must be called again with an updated handle range to continue the search.
sahilmgandhi 18:6a4db94011d3 342 *
sahilmgandhi 18:6a4db94011d3 343 * @events
sahilmgandhi 18:6a4db94011d3 344 * @event{@ref BLE_GATTC_EVT_REL_DISC_RSP}
sahilmgandhi 18:6a4db94011d3 345 * @endevents
sahilmgandhi 18:6a4db94011d3 346 *
sahilmgandhi 18:6a4db94011d3 347 * @mscs
sahilmgandhi 18:6a4db94011d3 348 * @mmsc{@ref BLE_GATTC_REL_DISC_MSC}
sahilmgandhi 18:6a4db94011d3 349 * @endmscs
sahilmgandhi 18:6a4db94011d3 350 *
sahilmgandhi 18:6a4db94011d3 351 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
sahilmgandhi 18:6a4db94011d3 352 * @param[in] p_handle_range A pointer to the range of handles of the Service to perform this procedure on.
sahilmgandhi 18:6a4db94011d3 353 *
sahilmgandhi 18:6a4db94011d3 354 * @retval ::NRF_SUCCESS Successfully started or resumed the Relationship Discovery procedure.
sahilmgandhi 18:6a4db94011d3 355 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
sahilmgandhi 18:6a4db94011d3 356 * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State.
sahilmgandhi 18:6a4db94011d3 357 * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
sahilmgandhi 18:6a4db94011d3 358 * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
sahilmgandhi 18:6a4db94011d3 359 * @retval ::NRF_ERROR_BUSY Client procedure already in progress.
sahilmgandhi 18:6a4db94011d3 360 */
sahilmgandhi 18:6a4db94011d3 361 SVCALL(SD_BLE_GATTC_RELATIONSHIPS_DISCOVER, uint32_t, sd_ble_gattc_relationships_discover(uint16_t conn_handle, ble_gattc_handle_range_t const *p_handle_range));
sahilmgandhi 18:6a4db94011d3 362
sahilmgandhi 18:6a4db94011d3 363
sahilmgandhi 18:6a4db94011d3 364 /**@brief Initiate or continue a GATT Characteristic Discovery procedure.
sahilmgandhi 18:6a4db94011d3 365 *
sahilmgandhi 18:6a4db94011d3 366 * @details This function initiates or resumes a Characteristic discovery procedure. If the last Characteristic has not been reached,
sahilmgandhi 18:6a4db94011d3 367 * this must be called again with an updated handle range to continue the discovery.
sahilmgandhi 18:6a4db94011d3 368 *
sahilmgandhi 18:6a4db94011d3 369 * @note If any of the discovered characteristics have 128-bit UUIDs which are not present in the table provided to ble_vs_uuids_assign, a UUID structure with
sahilmgandhi 18:6a4db94011d3 370 * type @ref BLE_UUID_TYPE_UNKNOWN will be received in the corresponding event.
sahilmgandhi 18:6a4db94011d3 371 *
sahilmgandhi 18:6a4db94011d3 372 * @events
sahilmgandhi 18:6a4db94011d3 373 * @event{@ref BLE_GATTC_EVT_CHAR_DISC_RSP}
sahilmgandhi 18:6a4db94011d3 374 * @endevents
sahilmgandhi 18:6a4db94011d3 375 *
sahilmgandhi 18:6a4db94011d3 376 * @mscs
sahilmgandhi 18:6a4db94011d3 377 * @mmsc{@ref BLE_GATTC_CHAR_DISC_MSC}
sahilmgandhi 18:6a4db94011d3 378 * @endmscs
sahilmgandhi 18:6a4db94011d3 379 *
sahilmgandhi 18:6a4db94011d3 380 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
sahilmgandhi 18:6a4db94011d3 381 * @param[in] p_handle_range A pointer to the range of handles of the Service to perform this procedure on.
sahilmgandhi 18:6a4db94011d3 382 *
sahilmgandhi 18:6a4db94011d3 383 * @retval ::NRF_SUCCESS Successfully started or resumed the Characteristic Discovery procedure.
sahilmgandhi 18:6a4db94011d3 384 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
sahilmgandhi 18:6a4db94011d3 385 * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State.
sahilmgandhi 18:6a4db94011d3 386 * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
sahilmgandhi 18:6a4db94011d3 387 * @retval ::NRF_ERROR_BUSY Client procedure already in progress.
sahilmgandhi 18:6a4db94011d3 388 */
sahilmgandhi 18:6a4db94011d3 389 SVCALL(SD_BLE_GATTC_CHARACTERISTICS_DISCOVER, uint32_t, sd_ble_gattc_characteristics_discover(uint16_t conn_handle, ble_gattc_handle_range_t const *p_handle_range));
sahilmgandhi 18:6a4db94011d3 390
sahilmgandhi 18:6a4db94011d3 391
sahilmgandhi 18:6a4db94011d3 392 /**@brief Initiate or continue a GATT Characteristic Descriptor Discovery procedure.
sahilmgandhi 18:6a4db94011d3 393 *
sahilmgandhi 18:6a4db94011d3 394 * @details This function initiates or resumes a Characteristic Descriptor discovery procedure. If the last Descriptor has not been reached,
sahilmgandhi 18:6a4db94011d3 395 * this must be called again with an updated handle range to continue the discovery.
sahilmgandhi 18:6a4db94011d3 396 *
sahilmgandhi 18:6a4db94011d3 397 * @events
sahilmgandhi 18:6a4db94011d3 398 * @event{BLE_GATTC_EVT_DESC_DISC_RSP}
sahilmgandhi 18:6a4db94011d3 399 * @endevents
sahilmgandhi 18:6a4db94011d3 400 *
sahilmgandhi 18:6a4db94011d3 401 * @mscs
sahilmgandhi 18:6a4db94011d3 402 * @mmsc{@ref BLE_GATTC_DESC_DISC_MSC}
sahilmgandhi 18:6a4db94011d3 403 * @endmscs
sahilmgandhi 18:6a4db94011d3 404 *
sahilmgandhi 18:6a4db94011d3 405 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
sahilmgandhi 18:6a4db94011d3 406 * @param[in] p_handle_range A pointer to the range of handles of the Characteristic to perform this procedure on.
sahilmgandhi 18:6a4db94011d3 407 *
sahilmgandhi 18:6a4db94011d3 408 * @retval ::NRF_SUCCESS Successfully started or resumed the Descriptor Discovery procedure.
sahilmgandhi 18:6a4db94011d3 409 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
sahilmgandhi 18:6a4db94011d3 410 * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State.
sahilmgandhi 18:6a4db94011d3 411 * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
sahilmgandhi 18:6a4db94011d3 412 * @retval ::NRF_ERROR_BUSY Client procedure already in progress.
sahilmgandhi 18:6a4db94011d3 413 */
sahilmgandhi 18:6a4db94011d3 414 SVCALL(SD_BLE_GATTC_DESCRIPTORS_DISCOVER, uint32_t, sd_ble_gattc_descriptors_discover(uint16_t conn_handle, ble_gattc_handle_range_t const *p_handle_range));
sahilmgandhi 18:6a4db94011d3 415
sahilmgandhi 18:6a4db94011d3 416
sahilmgandhi 18:6a4db94011d3 417 /**@brief Initiate or continue a GATT Read using Characteristic UUID procedure.
sahilmgandhi 18:6a4db94011d3 418 *
sahilmgandhi 18:6a4db94011d3 419 * @details This function initiates or resumes a Read using Characteristic UUID procedure. If the last Characteristic has not been reached,
sahilmgandhi 18:6a4db94011d3 420 * this must be called again with an updated handle range to continue the discovery.
sahilmgandhi 18:6a4db94011d3 421 *
sahilmgandhi 18:6a4db94011d3 422 * @events
sahilmgandhi 18:6a4db94011d3 423 * @event{BLE_GATTC_EVT_DESC_DISC_RSP}
sahilmgandhi 18:6a4db94011d3 424 * @endevents
sahilmgandhi 18:6a4db94011d3 425 *
sahilmgandhi 18:6a4db94011d3 426 * @mscs
sahilmgandhi 18:6a4db94011d3 427 * @mmsc{@ref BLE_GATTC_READ_UUID_MSC}
sahilmgandhi 18:6a4db94011d3 428 * @endmscs
sahilmgandhi 18:6a4db94011d3 429 *
sahilmgandhi 18:6a4db94011d3 430 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
sahilmgandhi 18:6a4db94011d3 431 * @param[in] p_uuid Pointer to a Characteristic value UUID to read.
sahilmgandhi 18:6a4db94011d3 432 * @param[in] p_handle_range A pointer to the range of handles to perform this procedure on.
sahilmgandhi 18:6a4db94011d3 433 *
sahilmgandhi 18:6a4db94011d3 434 * @retval ::NRF_SUCCESS Successfully started or resumed the Read using Characteristic UUID procedure.
sahilmgandhi 18:6a4db94011d3 435 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
sahilmgandhi 18:6a4db94011d3 436 * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State.
sahilmgandhi 18:6a4db94011d3 437 * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
sahilmgandhi 18:6a4db94011d3 438 * @retval ::NRF_ERROR_BUSY Client procedure already in progress.
sahilmgandhi 18:6a4db94011d3 439 */
sahilmgandhi 18:6a4db94011d3 440 SVCALL(SD_BLE_GATTC_CHAR_VALUE_BY_UUID_READ, uint32_t, sd_ble_gattc_char_value_by_uuid_read(uint16_t conn_handle, ble_uuid_t const *p_uuid, ble_gattc_handle_range_t const *p_handle_range));
sahilmgandhi 18:6a4db94011d3 441
sahilmgandhi 18:6a4db94011d3 442
sahilmgandhi 18:6a4db94011d3 443 /**@brief Initiate or continue a GATT Read (Long) Characteristic or Descriptor procedure.
sahilmgandhi 18:6a4db94011d3 444 *
sahilmgandhi 18:6a4db94011d3 445 * @details This function initiates or resumes a GATT Read (Long) Characteristic or Descriptor procedure. If the Characteristic or Descriptor
sahilmgandhi 18:6a4db94011d3 446 * to be read is longer than ATT_MTU - 1, this function must be called multiple times with appropriate offset to read the
sahilmgandhi 18:6a4db94011d3 447 * complete value.
sahilmgandhi 18:6a4db94011d3 448 *
sahilmgandhi 18:6a4db94011d3 449 * @events
sahilmgandhi 18:6a4db94011d3 450 * @event{@ref BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP}
sahilmgandhi 18:6a4db94011d3 451 * @endevents
sahilmgandhi 18:6a4db94011d3 452 *
sahilmgandhi 18:6a4db94011d3 453 * @mscs
sahilmgandhi 18:6a4db94011d3 454 * @mmsc{@ref BLE_GATTC_VALUE_READ_MSC}
sahilmgandhi 18:6a4db94011d3 455 * @endmscs
sahilmgandhi 18:6a4db94011d3 456 *
sahilmgandhi 18:6a4db94011d3 457 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
sahilmgandhi 18:6a4db94011d3 458 * @param[in] handle The handle of the attribute to be read.
sahilmgandhi 18:6a4db94011d3 459 * @param[in] offset Offset into the attribute value to be read.
sahilmgandhi 18:6a4db94011d3 460 *
sahilmgandhi 18:6a4db94011d3 461 * @retval ::NRF_SUCCESS Successfully started or resumed the Read (Long) procedure.
sahilmgandhi 18:6a4db94011d3 462 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
sahilmgandhi 18:6a4db94011d3 463 * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State.
sahilmgandhi 18:6a4db94011d3 464 * @retval ::NRF_ERROR_BUSY Client procedure already in progress.
sahilmgandhi 18:6a4db94011d3 465 */
sahilmgandhi 18:6a4db94011d3 466 SVCALL(SD_BLE_GATTC_READ, uint32_t, sd_ble_gattc_read(uint16_t conn_handle, uint16_t handle, uint16_t offset));
sahilmgandhi 18:6a4db94011d3 467
sahilmgandhi 18:6a4db94011d3 468
sahilmgandhi 18:6a4db94011d3 469 /**@brief Initiate a GATT Read Multiple Characteristic Values procedure.
sahilmgandhi 18:6a4db94011d3 470 *
sahilmgandhi 18:6a4db94011d3 471 * @details This function initiates a GATT Read Multiple Characteristic Values procedure.
sahilmgandhi 18:6a4db94011d3 472 *
sahilmgandhi 18:6a4db94011d3 473 * @events
sahilmgandhi 18:6a4db94011d3 474 * @event{@ref BLE_GATTC_EVT_CHAR_VALS_READ_RSP}
sahilmgandhi 18:6a4db94011d3 475 * @endevents
sahilmgandhi 18:6a4db94011d3 476 *
sahilmgandhi 18:6a4db94011d3 477 * @mscs
sahilmgandhi 18:6a4db94011d3 478 * @mmsc{@ref BLE_GATTC_READ_MULT_MSC}
sahilmgandhi 18:6a4db94011d3 479 * @endmscs
sahilmgandhi 18:6a4db94011d3 480 *
sahilmgandhi 18:6a4db94011d3 481 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
sahilmgandhi 18:6a4db94011d3 482 * @param[in] p_handles A pointer to the handle(s) of the attribute(s) to be read.
sahilmgandhi 18:6a4db94011d3 483 * @param[in] handle_count The number of handles in p_handles.
sahilmgandhi 18:6a4db94011d3 484 *
sahilmgandhi 18:6a4db94011d3 485 * @retval ::NRF_SUCCESS Successfully started the Read Multiple Characteristic Values procedure.
sahilmgandhi 18:6a4db94011d3 486 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
sahilmgandhi 18:6a4db94011d3 487 * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State.
sahilmgandhi 18:6a4db94011d3 488 * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
sahilmgandhi 18:6a4db94011d3 489 * @retval ::NRF_ERROR_BUSY Client procedure already in progress.
sahilmgandhi 18:6a4db94011d3 490 */
sahilmgandhi 18:6a4db94011d3 491 SVCALL(SD_BLE_GATTC_CHAR_VALUES_READ, uint32_t, sd_ble_gattc_char_values_read(uint16_t conn_handle, uint16_t const *p_handles, uint16_t handle_count));
sahilmgandhi 18:6a4db94011d3 492
sahilmgandhi 18:6a4db94011d3 493
sahilmgandhi 18:6a4db94011d3 494 /**@brief Perform a Write (Characteristic Value or Descriptor, with or without response, signed or not, long or reliable) procedure.
sahilmgandhi 18:6a4db94011d3 495 *
sahilmgandhi 18:6a4db94011d3 496 * @details This function can perform all write procedures described in GATT.
sahilmgandhi 18:6a4db94011d3 497 *
sahilmgandhi 18:6a4db94011d3 498 * @note It is important to note that a write without response will <b>consume an application buffer</b>, and will therefore
sahilmgandhi 18:6a4db94011d3 499 * generate a @ref BLE_EVT_TX_COMPLETE event when the packet has been transmitted. A write (with response) on the other hand will use the
sahilmgandhi 18:6a4db94011d3 500 * standard client internal buffer and thus will only generate a @ref BLE_GATTC_EVT_WRITE_RSP event as soon as the write response
sahilmgandhi 18:6a4db94011d3 501 * has been received from the peer. Please see the documentation of @ref sd_ble_tx_packet_count_get for more details.
sahilmgandhi 18:6a4db94011d3 502 *
sahilmgandhi 18:6a4db94011d3 503 * @events
sahilmgandhi 18:6a4db94011d3 504 * @event{@ref BLE_GATTC_EVT_WRITE_RSP, Generated when using write request or queued writes.}
sahilmgandhi 18:6a4db94011d3 505 * @endevents
sahilmgandhi 18:6a4db94011d3 506 *
sahilmgandhi 18:6a4db94011d3 507 * @mscs
sahilmgandhi 18:6a4db94011d3 508 * @mmsc{@ref BLE_GATTC_VALUE_WRITE_MSC}
sahilmgandhi 18:6a4db94011d3 509 * @mmsc{@ref BLE_GATTC_VALUE_LONG_WRITE_MSC}
sahilmgandhi 18:6a4db94011d3 510 * @mmsc{@ref BLE_GATTC_VALUE_RELIABLE_WRITE_MSC}
sahilmgandhi 18:6a4db94011d3 511 * @mmsc{@ref BLE_COMMON_APP_BUFF_MSC}
sahilmgandhi 18:6a4db94011d3 512 * @endmscs
sahilmgandhi 18:6a4db94011d3 513 *
sahilmgandhi 18:6a4db94011d3 514 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
sahilmgandhi 18:6a4db94011d3 515 * @param[in] p_write_params A pointer to a write parameters structure.
sahilmgandhi 18:6a4db94011d3 516 *
sahilmgandhi 18:6a4db94011d3 517 * @retval ::NRF_SUCCESS Successfully started the Write procedure.
sahilmgandhi 18:6a4db94011d3 518 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
sahilmgandhi 18:6a4db94011d3 519 * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State.
sahilmgandhi 18:6a4db94011d3 520 * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
sahilmgandhi 18:6a4db94011d3 521 * @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
sahilmgandhi 18:6a4db94011d3 522 * @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied.
sahilmgandhi 18:6a4db94011d3 523 * @retval ::NRF_ERROR_BUSY Procedure already in progress.
sahilmgandhi 18:6a4db94011d3 524 * @retval ::BLE_ERROR_NO_TX_PACKETS No available application packets for this connection.
sahilmgandhi 18:6a4db94011d3 525 */
sahilmgandhi 18:6a4db94011d3 526 SVCALL(SD_BLE_GATTC_WRITE, uint32_t, sd_ble_gattc_write(uint16_t conn_handle, ble_gattc_write_params_t const *p_write_params));
sahilmgandhi 18:6a4db94011d3 527
sahilmgandhi 18:6a4db94011d3 528
sahilmgandhi 18:6a4db94011d3 529 /**@brief Send a Handle Value Confirmation to the GATT Server.
sahilmgandhi 18:6a4db94011d3 530 *
sahilmgandhi 18:6a4db94011d3 531 * @mscs
sahilmgandhi 18:6a4db94011d3 532 * @mmsc{@ref BLE_GATTC_HVI_MSC}
sahilmgandhi 18:6a4db94011d3 533 * @endmscs
sahilmgandhi 18:6a4db94011d3 534 *
sahilmgandhi 18:6a4db94011d3 535 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
sahilmgandhi 18:6a4db94011d3 536 * @param[in] handle The handle of the attribute in the indication.
sahilmgandhi 18:6a4db94011d3 537 *
sahilmgandhi 18:6a4db94011d3 538 * @retval ::NRF_SUCCESS Successfully queued the Handle Value Confirmation for transmission.
sahilmgandhi 18:6a4db94011d3 539 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
sahilmgandhi 18:6a4db94011d3 540 * @retval ::NRF_ERROR_INVALID_STATE Invalid Connection State or no Indication pending to be confirmed.
sahilmgandhi 18:6a4db94011d3 541 * @retval ::BLE_ERROR_INVALID_ATTR_HANDLE Invalid attribute handle.
sahilmgandhi 18:6a4db94011d3 542 */
sahilmgandhi 18:6a4db94011d3 543 SVCALL(SD_BLE_GATTC_HV_CONFIRM, uint32_t, sd_ble_gattc_hv_confirm(uint16_t conn_handle, uint16_t handle));
sahilmgandhi 18:6a4db94011d3 544
sahilmgandhi 18:6a4db94011d3 545 /**@brief Discovers information about a range of attributes on a GATT server.
sahilmgandhi 18:6a4db94011d3 546 *
sahilmgandhi 18:6a4db94011d3 547 * @events
sahilmgandhi 18:6a4db94011d3 548 * @event{@ref BLE_GATTC_EVT_ATTR_INFO_DISC_RSP, Generated when information about a range of attributes has been received.}
sahilmgandhi 18:6a4db94011d3 549 * @endevents
sahilmgandhi 18:6a4db94011d3 550 *
sahilmgandhi 18:6a4db94011d3 551 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
sahilmgandhi 18:6a4db94011d3 552 * @param[in] p_handle_range The range of handles to request information about.
sahilmgandhi 18:6a4db94011d3 553 *
sahilmgandhi 18:6a4db94011d3 554 * @retval ::NRF_SUCCESS Successfully started an attribute information discovery procedure.
sahilmgandhi 18:6a4db94011d3 555 * @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle.
sahilmgandhi 18:6a4db94011d3 556 * @retval ::NRF_ERROR_INVALID_STATE Invalid connection state
sahilmgandhi 18:6a4db94011d3 557 * @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
sahilmgandhi 18:6a4db94011d3 558 * @retval ::NRF_ERROR_BUSY Client procedure already in progress.
sahilmgandhi 18:6a4db94011d3 559 */
sahilmgandhi 18:6a4db94011d3 560 SVCALL(SD_BLE_GATTC_ATTR_INFO_DISCOVER, uint32_t, sd_ble_gattc_attr_info_discover(uint16_t conn_handle, ble_gattc_handle_range_t const * p_handle_range));
sahilmgandhi 18:6a4db94011d3 561
sahilmgandhi 18:6a4db94011d3 562 /** @} */
sahilmgandhi 18:6a4db94011d3 563
sahilmgandhi 18:6a4db94011d3 564 #ifdef __cplusplus
sahilmgandhi 18:6a4db94011d3 565 }
sahilmgandhi 18:6a4db94011d3 566 #endif
sahilmgandhi 18:6a4db94011d3 567 #endif /* NRF_BLE_GATTC_H__ */
sahilmgandhi 18:6a4db94011d3 568
sahilmgandhi 18:6a4db94011d3 569 /**
sahilmgandhi 18:6a4db94011d3 570 @}
sahilmgandhi 18:6a4db94011d3 571 @}
sahilmgandhi 18:6a4db94011d3 572 */