meh

Fork of mbed by mbed official

Committer:
bogdanm
Date:
Fri Aug 15 15:28:31 2014 +0100
Revision:
88:9327015d4013
Parent:
TARGET_RBLAB_NRF51822/TARGET_NORDIC/TARGET_NRF51822/Lib/s110_nrf51822_7_0_0/s110_nrf51822_7.0.0_API/include/ble_gattc.h@87:6213f644d804
Release 88 of the mbed library

Main changes:

- changed "error.h" to "mbed_error.h" to avoid conflicts with 3rd party code
- LPC1549 SPI driver fixes
- K64F Ethernet TX buffer reclaim mechanism fix
- STDIO initialization fix
- NUCLEO_F334R8 I2C clock fix
- various other fixes

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bogdanm 87:6213f644d804 1 /* Copyright (c) 2012 Nordic Semiconductor. All Rights Reserved.
bogdanm 87:6213f644d804 2 *
bogdanm 87:6213f644d804 3 * The information contained herein is confidential property of Nordic Semiconductor. The use,
bogdanm 87:6213f644d804 4 * copying, transfer or disclosure of such information is prohibited except by express written
bogdanm 87:6213f644d804 5 * agreement with Nordic Semiconductor.
bogdanm 87:6213f644d804 6 *
bogdanm 87:6213f644d804 7 */
bogdanm 87:6213f644d804 8 /**
bogdanm 87:6213f644d804 9 @addtogroup BLE_GATTC Generic Attribute Profile (GATT) Client
bogdanm 87:6213f644d804 10 @{
bogdanm 87:6213f644d804 11 @brief Definitions and prototypes for the GATT Client interface.
bogdanm 87:6213f644d804 12 */
bogdanm 87:6213f644d804 13
bogdanm 87:6213f644d804 14 #ifndef BLE_GATTC_H__
bogdanm 87:6213f644d804 15 #define BLE_GATTC_H__
bogdanm 87:6213f644d804 16
bogdanm 87:6213f644d804 17 #include "ble_gatt.h"
bogdanm 87:6213f644d804 18 #include "ble_types.h"
bogdanm 87:6213f644d804 19 #include "ble_ranges.h"
bogdanm 87:6213f644d804 20 #include "nrf_svc.h"
bogdanm 87:6213f644d804 21
bogdanm 87:6213f644d804 22 /** @addtogroup BLE_GATTC_ENUMERATIONS Enumerations
bogdanm 87:6213f644d804 23 * @{ */
bogdanm 87:6213f644d804 24
bogdanm 87:6213f644d804 25 /**@brief GATTC API SVC numbers. */
bogdanm 87:6213f644d804 26 enum BLE_GATTC_SVCS
bogdanm 87:6213f644d804 27 {
bogdanm 87:6213f644d804 28 SD_BLE_GATTC_PRIMARY_SERVICES_DISCOVER = BLE_GATTC_SVC_BASE, /**< Primary Service Discovery. */
bogdanm 87:6213f644d804 29 SD_BLE_GATTC_RELATIONSHIPS_DISCOVER, /**< Relationship Discovery. */
bogdanm 87:6213f644d804 30 SD_BLE_GATTC_CHARACTERISTICS_DISCOVER, /**< Characteristic Discovery. */
bogdanm 87:6213f644d804 31 SD_BLE_GATTC_DESCRIPTORS_DISCOVER, /**< Characteristic Descriptor Discovery. */
bogdanm 87:6213f644d804 32 SD_BLE_GATTC_CHAR_VALUE_BY_UUID_READ, /**< Read Characteristic Value by UUID. */
bogdanm 87:6213f644d804 33 SD_BLE_GATTC_READ, /**< Generic read. */
bogdanm 87:6213f644d804 34 SD_BLE_GATTC_CHAR_VALUES_READ, /**< Read multiple Characteristic Values. */
bogdanm 87:6213f644d804 35 SD_BLE_GATTC_WRITE, /**< Generic write. */
bogdanm 87:6213f644d804 36 SD_BLE_GATTC_HV_CONFIRM /**< Handle Value Confirmation. */
bogdanm 87:6213f644d804 37 };
bogdanm 87:6213f644d804 38
bogdanm 87:6213f644d804 39 /** @} */
bogdanm 87:6213f644d804 40
bogdanm 87:6213f644d804 41 /** @addtogroup BLE_GATTC_DEFINES Defines
bogdanm 87:6213f644d804 42 * @{ */
bogdanm 87:6213f644d804 43
bogdanm 87:6213f644d804 44 /** @defgroup BLE_ERRORS_GATTC SVC return values specific to GATTC
bogdanm 87:6213f644d804 45 * @{ */
bogdanm 87:6213f644d804 46 #define BLE_ERROR_GATTC_PROC_NOT_PERMITTED (NRF_GATTC_ERR_BASE + 0x000)
bogdanm 87:6213f644d804 47 /** @} */
bogdanm 87:6213f644d804 48
bogdanm 87:6213f644d804 49 /**@brief Last Attribute Handle. */
bogdanm 87:6213f644d804 50 #define BLE_GATTC_HANDLE_END 0xFFFF
bogdanm 87:6213f644d804 51
bogdanm 87:6213f644d804 52 /** @} */
bogdanm 87:6213f644d804 53
bogdanm 87:6213f644d804 54 /** @addtogroup BLE_GATTC_STRUCTURES Structures
bogdanm 87:6213f644d804 55 * @{ */
bogdanm 87:6213f644d804 56
bogdanm 87:6213f644d804 57 /**@brief Operation Handle Range. */
bogdanm 87:6213f644d804 58 typedef struct
bogdanm 87:6213f644d804 59 {
bogdanm 87:6213f644d804 60 uint16_t start_handle; /**< Start Handle. */
bogdanm 87:6213f644d804 61 uint16_t end_handle; /**< End Handle. */
bogdanm 87:6213f644d804 62 } ble_gattc_handle_range_t;
bogdanm 87:6213f644d804 63
bogdanm 87:6213f644d804 64
bogdanm 87:6213f644d804 65 /**@brief GATT service. */
bogdanm 87:6213f644d804 66 typedef struct
bogdanm 87:6213f644d804 67 {
bogdanm 87:6213f644d804 68 ble_uuid_t uuid; /**< Service UUID. */
bogdanm 87:6213f644d804 69 ble_gattc_handle_range_t handle_range; /**< Service Handle Range. */
bogdanm 87:6213f644d804 70 } ble_gattc_service_t;
bogdanm 87:6213f644d804 71
bogdanm 87:6213f644d804 72
bogdanm 87:6213f644d804 73 /**@brief GATT include. */
bogdanm 87:6213f644d804 74 typedef struct
bogdanm 87:6213f644d804 75 {
bogdanm 87:6213f644d804 76 uint16_t handle; /**< Include Handle. */
bogdanm 87:6213f644d804 77 ble_gattc_service_t included_srvc; /**< Handle of the included service. */
bogdanm 87:6213f644d804 78 } ble_gattc_include_t;
bogdanm 87:6213f644d804 79
bogdanm 87:6213f644d804 80
bogdanm 87:6213f644d804 81 /**@brief GATT characteristic. */
bogdanm 87:6213f644d804 82 typedef struct
bogdanm 87:6213f644d804 83 {
bogdanm 87:6213f644d804 84 ble_uuid_t uuid; /**< Characteristic UUID. */
bogdanm 87:6213f644d804 85 ble_gatt_char_props_t char_props; /**< Characteristic Properties. */
bogdanm 87:6213f644d804 86 uint8_t char_ext_props : 1; /**< Extended properties present. */
bogdanm 87:6213f644d804 87 uint16_t handle_decl; /**< Handle of the Characteristic Declaration. */
bogdanm 87:6213f644d804 88 uint16_t handle_value; /**< Handle of the Characteristic Value. */
bogdanm 87:6213f644d804 89 } ble_gattc_char_t;
bogdanm 87:6213f644d804 90
bogdanm 87:6213f644d804 91
bogdanm 87:6213f644d804 92 /**@brief GATT descriptor. */
bogdanm 87:6213f644d804 93 typedef struct
bogdanm 87:6213f644d804 94 {
bogdanm 87:6213f644d804 95 uint16_t handle; /**< Descriptor Handle. */
bogdanm 87:6213f644d804 96 ble_uuid_t uuid; /**< Descriptor UUID. */
bogdanm 87:6213f644d804 97 } ble_gattc_desc_t;
bogdanm 87:6213f644d804 98
bogdanm 87:6213f644d804 99
bogdanm 87:6213f644d804 100 /**@brief Write Parameters. */
bogdanm 87:6213f644d804 101 typedef struct
bogdanm 87:6213f644d804 102 {
bogdanm 87:6213f644d804 103 uint8_t write_op; /**< Write Operation to be performed, see @ref BLE_GATT_WRITE_OPS. */
bogdanm 87:6213f644d804 104 uint16_t handle; /**< Handle to the attribute to be written. */
bogdanm 87:6213f644d804 105 uint16_t offset; /**< Offset in bytes. @note For WRITE_CMD and WRITE_REQ, offset must be 0. */
bogdanm 87:6213f644d804 106 uint16_t len; /**< Length of data in bytes. */
bogdanm 87:6213f644d804 107 uint8_t* p_value; /**< Pointer to the value data. */
bogdanm 87:6213f644d804 108 uint8_t flags; /**< Flags, see @ref BLE_GATT_EXEC_WRITE_FLAGS. */
bogdanm 87:6213f644d804 109 } ble_gattc_write_params_t;
bogdanm 87:6213f644d804 110
bogdanm 87:6213f644d804 111
bogdanm 87:6213f644d804 112 /**
bogdanm 87:6213f644d804 113 * @brief GATT Client Event IDs.
bogdanm 87:6213f644d804 114 */
bogdanm 87:6213f644d804 115 enum BLE_GATTC_EVTS
bogdanm 87:6213f644d804 116 {
bogdanm 87:6213f644d804 117 BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP = BLE_GATTC_EVT_BASE, /**< Primary Service Discovery Response event. */
bogdanm 87:6213f644d804 118 BLE_GATTC_EVT_REL_DISC_RSP, /**< Relationship Discovery Response event. */
bogdanm 87:6213f644d804 119 BLE_GATTC_EVT_CHAR_DISC_RSP, /**< Characteristic Discovery Response event. */
bogdanm 87:6213f644d804 120 BLE_GATTC_EVT_DESC_DISC_RSP, /**< Descriptor Discovery Response event. */
bogdanm 87:6213f644d804 121 BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP, /**< Read By UUID Response event. */
bogdanm 87:6213f644d804 122 BLE_GATTC_EVT_READ_RSP, /**< Read Response event. */
bogdanm 87:6213f644d804 123 BLE_GATTC_EVT_CHAR_VALS_READ_RSP, /**< Read multiple Response event. */
bogdanm 87:6213f644d804 124 BLE_GATTC_EVT_WRITE_RSP, /**< Write Response event. */
bogdanm 87:6213f644d804 125 BLE_GATTC_EVT_HVX, /**< Handle Value Notification or Indication event. */
bogdanm 87:6213f644d804 126 BLE_GATTC_EVT_TIMEOUT /**< Timeout event. */
bogdanm 87:6213f644d804 127 };
bogdanm 87:6213f644d804 128
bogdanm 87:6213f644d804 129 /**@brief Event structure for BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP. */
bogdanm 87:6213f644d804 130 typedef struct
bogdanm 87:6213f644d804 131 {
bogdanm 87:6213f644d804 132 uint16_t count; /**< Service count. */
bogdanm 87:6213f644d804 133 ble_gattc_service_t services[1]; /**< Service data, variable length. */
bogdanm 87:6213f644d804 134 } ble_gattc_evt_prim_srvc_disc_rsp_t;
bogdanm 87:6213f644d804 135
bogdanm 87:6213f644d804 136 /**@brief Event structure for BLE_GATTC_EVT_REL_DISC_RSP. */
bogdanm 87:6213f644d804 137 typedef struct
bogdanm 87:6213f644d804 138 {
bogdanm 87:6213f644d804 139 uint16_t count; /**< Include count. */
bogdanm 87:6213f644d804 140 ble_gattc_include_t includes[1]; /**< Include data, variable length. */
bogdanm 87:6213f644d804 141 } ble_gattc_evt_rel_disc_rsp_t;
bogdanm 87:6213f644d804 142
bogdanm 87:6213f644d804 143 /**@brief Event structure for BLE_GATTC_EVT_CHAR_DISC_RSP. */
bogdanm 87:6213f644d804 144 typedef struct
bogdanm 87:6213f644d804 145 {
bogdanm 87:6213f644d804 146 uint16_t count; /**< Characteristic count. */
bogdanm 87:6213f644d804 147 ble_gattc_char_t chars[1]; /**< Characteristic data, variable length. */
bogdanm 87:6213f644d804 148 } ble_gattc_evt_char_disc_rsp_t;
bogdanm 87:6213f644d804 149
bogdanm 87:6213f644d804 150 /**@brief Event structure for BLE_GATTC_EVT_DESC_DISC_RSP. */
bogdanm 87:6213f644d804 151 typedef struct
bogdanm 87:6213f644d804 152 {
bogdanm 87:6213f644d804 153 uint16_t count; /**< Descriptor count. */
bogdanm 87:6213f644d804 154 ble_gattc_desc_t descs[1]; /**< Descriptor data, variable length. */
bogdanm 87:6213f644d804 155 } ble_gattc_evt_desc_disc_rsp_t;
bogdanm 87:6213f644d804 156
bogdanm 87:6213f644d804 157 /**@brief GATT read by UUID handle value pair. */
bogdanm 87:6213f644d804 158 typedef struct
bogdanm 87:6213f644d804 159 {
bogdanm 87:6213f644d804 160 uint16_t handle; /**< Attribute Handle. */
bogdanm 87:6213f644d804 161 uint8_t *p_value; /**< Pointer to value, variable length (length available as value_len in ble_gattc_evt_read_by_uuid_rsp_t).
bogdanm 87:6213f644d804 162 Please note that this pointer is absolute to the memory provided by the user when retrieving the event,
bogdanm 87:6213f644d804 163 so it will effectively point to a location inside the handle_value array. */
bogdanm 87:6213f644d804 164 } ble_gattc_handle_value_t;
bogdanm 87:6213f644d804 165
bogdanm 87:6213f644d804 166 /**@brief Event structure for BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP. */
bogdanm 87:6213f644d804 167 typedef struct
bogdanm 87:6213f644d804 168 {
bogdanm 87:6213f644d804 169 uint16_t count; /**< Handle-Value Pair Count. */
bogdanm 87:6213f644d804 170 uint16_t value_len; /**< Length of the value in Handle-Value(s) list. */
bogdanm 87:6213f644d804 171 ble_gattc_handle_value_t handle_value[1]; /**< Handle-Value(s) list, variable length. */
bogdanm 87:6213f644d804 172 } ble_gattc_evt_char_val_by_uuid_read_rsp_t;
bogdanm 87:6213f644d804 173
bogdanm 87:6213f644d804 174 /**@brief Event structure for BLE_GATTC_EVT_READ_RSP. */
bogdanm 87:6213f644d804 175 typedef struct
bogdanm 87:6213f644d804 176 {
bogdanm 87:6213f644d804 177 uint16_t handle; /**< Attribute Handle. */
bogdanm 87:6213f644d804 178 uint16_t offset; /**< Offset of the attribute data. */
bogdanm 87:6213f644d804 179 uint16_t len; /**< Attribute data length. */
bogdanm 87:6213f644d804 180 uint8_t data[1]; /**< Attribute data, variable length. */
bogdanm 87:6213f644d804 181 } ble_gattc_evt_read_rsp_t;
bogdanm 87:6213f644d804 182
bogdanm 87:6213f644d804 183 /**@brief Event structure for BLE_GATTC_EVT_CHAR_VALS_READ_RSP. */
bogdanm 87:6213f644d804 184 typedef struct
bogdanm 87:6213f644d804 185 {
bogdanm 87:6213f644d804 186 uint16_t len; /**< Concatenated Attribute values length. */
bogdanm 87:6213f644d804 187 uint8_t values[1]; /**< Attribute values, variable length. */
bogdanm 87:6213f644d804 188 } ble_gattc_evt_char_vals_read_rsp_t;
bogdanm 87:6213f644d804 189
bogdanm 87:6213f644d804 190 /**@brief Event structure for BLE_GATTC_EVT_WRITE_RSP. */
bogdanm 87:6213f644d804 191 typedef struct
bogdanm 87:6213f644d804 192 {
bogdanm 87:6213f644d804 193 uint16_t handle; /**< Attribute Handle. */
bogdanm 87:6213f644d804 194 uint8_t write_op; /**< Type of write operation, see @ref BLE_GATT_WRITE_OPS. */
bogdanm 87:6213f644d804 195 uint16_t offset; /**< Data Offset. */
bogdanm 87:6213f644d804 196 uint16_t len; /**< Data length. */
bogdanm 87:6213f644d804 197 uint8_t data[1]; /**< Data, variable length. */
bogdanm 87:6213f644d804 198 } ble_gattc_evt_write_rsp_t;
bogdanm 87:6213f644d804 199
bogdanm 87:6213f644d804 200 /**@brief Event structure for BLE_GATTC_EVT_HVX. */
bogdanm 87:6213f644d804 201 typedef struct
bogdanm 87:6213f644d804 202 {
bogdanm 87:6213f644d804 203 uint16_t handle; /**< Handle to which the HVx operation applies. */
bogdanm 87:6213f644d804 204 uint8_t type; /**< Indication or Notification, see @ref BLE_GATT_HVX_TYPES. */
bogdanm 87:6213f644d804 205 uint16_t len; /**< Attribute data length. */
bogdanm 87:6213f644d804 206 uint8_t data[1]; /**< Attribute data, variable length. */
bogdanm 87:6213f644d804 207 } ble_gattc_evt_hvx_t;
bogdanm 87:6213f644d804 208
bogdanm 87:6213f644d804 209 /**@brief Event structure for BLE_GATTC_EVT_TIMEOUT. */
bogdanm 87:6213f644d804 210 typedef struct
bogdanm 87:6213f644d804 211 {
bogdanm 87:6213f644d804 212 uint8_t src; /**< Timeout source, see @ref BLE_GATT_TIMEOUT_SOURCES. */
bogdanm 87:6213f644d804 213 } ble_gattc_evt_timeout_t;
bogdanm 87:6213f644d804 214
bogdanm 87:6213f644d804 215 /**@brief GATTC event type. */
bogdanm 87:6213f644d804 216 typedef struct
bogdanm 87:6213f644d804 217 {
bogdanm 87:6213f644d804 218 uint16_t conn_handle; /**< Connection Handle on which event occured. */
bogdanm 87:6213f644d804 219 uint16_t gatt_status; /**< GATT status code for the operation, see @ref BLE_GATT_STATUS_CODES. */
bogdanm 87:6213f644d804 220 uint16_t error_handle; /**< In case of error: The handle causing the error. In all other cases BLE_GATT_HANDLE_INVALID. */
bogdanm 87:6213f644d804 221 union
bogdanm 87:6213f644d804 222 {
bogdanm 87:6213f644d804 223 ble_gattc_evt_prim_srvc_disc_rsp_t prim_srvc_disc_rsp; /**< Primary Service Discovery Response Event Parameters. */
bogdanm 87:6213f644d804 224 ble_gattc_evt_rel_disc_rsp_t rel_disc_rsp; /**< Relationship Discovery Response Event Parameters. */
bogdanm 87:6213f644d804 225 ble_gattc_evt_char_disc_rsp_t char_disc_rsp; /**< Characteristic Discovery Response Event Parameters. */
bogdanm 87:6213f644d804 226 ble_gattc_evt_desc_disc_rsp_t desc_disc_rsp; /**< Descriptor Discovery Response Event Parameters. */
bogdanm 87:6213f644d804 227 ble_gattc_evt_char_val_by_uuid_read_rsp_t char_val_by_uuid_read_rsp; /**< Characteristic Value Read by UUID Response Event Parameters. */
bogdanm 87:6213f644d804 228 ble_gattc_evt_read_rsp_t read_rsp; /**< Read Response Event Parameters. */
bogdanm 87:6213f644d804 229 ble_gattc_evt_char_vals_read_rsp_t char_vals_read_rsp; /**< Characteristic Values Read Response Event Parameters. */
bogdanm 87:6213f644d804 230 ble_gattc_evt_write_rsp_t write_rsp; /**< Write Response Event Parameters. */
bogdanm 87:6213f644d804 231 ble_gattc_evt_hvx_t hvx; /**< Handle Value Notification/Indication Event Parameters. */
bogdanm 87:6213f644d804 232 ble_gattc_evt_timeout_t timeout; /**< Timeout Event Parameters. */
bogdanm 87:6213f644d804 233 } params; /**< Event Parameters. @note Only valid if @ref gatt_status == BLE_GATT_STATUS_SUCCESS. */
bogdanm 87:6213f644d804 234 } ble_gattc_evt_t;
bogdanm 87:6213f644d804 235 /** @} */
bogdanm 87:6213f644d804 236
bogdanm 87:6213f644d804 237 /** @addtogroup BLE_GATTC_FUNCTIONS Functions
bogdanm 87:6213f644d804 238 * @{ */
bogdanm 87:6213f644d804 239
bogdanm 87:6213f644d804 240 /**@brief Initiate or continue a GATT Primary Service Discovery procedure.
bogdanm 87:6213f644d804 241 *
bogdanm 87:6213f644d804 242 * @details This function initiates a Primary Service discovery, starting from the supplied handle.
bogdanm 87:6213f644d804 243 * If the last service has not been reached, this must be called again with an updated start handle value to continue the search.
bogdanm 87:6213f644d804 244 *
bogdanm 87:6213f644d804 245 * @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
bogdanm 87:6213f644d804 246 * type BLE_UUID_TYPE_UNKNOWN will be received in the corresponding event.
bogdanm 87:6213f644d804 247 *
bogdanm 87:6213f644d804 248 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
bogdanm 87:6213f644d804 249 * @param[in] start_handle Handle to start searching from.
bogdanm 87:6213f644d804 250 * @param[in] p_srvc_uuid Pointer to the service UUID to be found. If it is NULL, all primary services will be returned.
bogdanm 87:6213f644d804 251 *
bogdanm 87:6213f644d804 252 * @return @ref NRF_SUCCESS Successfully started or resumed the Primary Service Discovery procedure.
bogdanm 87:6213f644d804 253 * @return @ref BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
bogdanm 87:6213f644d804 254 * @return @ref NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
bogdanm 87:6213f644d804 255 * @return @ref NRF_ERROR_BUSY Client procedure already in progress.
bogdanm 87:6213f644d804 256 */
bogdanm 87:6213f644d804 257 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 * const p_srvc_uuid));
bogdanm 87:6213f644d804 258
bogdanm 87:6213f644d804 259
bogdanm 87:6213f644d804 260 /**@brief Initiate or continue a GATT Relationship Discovery procedure.
bogdanm 87:6213f644d804 261 *
bogdanm 87:6213f644d804 262 * @details This function initiates the Find Included Services sub-procedure. If the last included service has not been reached,
bogdanm 87:6213f644d804 263 * this must be called again with an updated handle range to continue the search.
bogdanm 87:6213f644d804 264 *
bogdanm 87:6213f644d804 265 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
bogdanm 87:6213f644d804 266 * @param[in] p_handle_range A pointer to the range of handles of the Service to perform this procedure on.
bogdanm 87:6213f644d804 267 *
bogdanm 87:6213f644d804 268 * @return @ref NRF_SUCCESS Successfully started or resumed the Relationship Discovery procedure.
bogdanm 87:6213f644d804 269 * @return @ref BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
bogdanm 87:6213f644d804 270 * @return @ref NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
bogdanm 87:6213f644d804 271 * @return @ref NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
bogdanm 87:6213f644d804 272 * @return @ref NRF_ERROR_BUSY Client procedure already in progress.
bogdanm 87:6213f644d804 273 */
bogdanm 87:6213f644d804 274 SVCALL(SD_BLE_GATTC_RELATIONSHIPS_DISCOVER, uint32_t, sd_ble_gattc_relationships_discover(uint16_t conn_handle, ble_gattc_handle_range_t const * const p_handle_range));
bogdanm 87:6213f644d804 275
bogdanm 87:6213f644d804 276
bogdanm 87:6213f644d804 277 /**@brief Initiate or continue a GATT Characteristic Discovery procedure.
bogdanm 87:6213f644d804 278 *
bogdanm 87:6213f644d804 279 * @details This function initiates a Characteristic discovery procedure. If the last Characteristic has not been reached,
bogdanm 87:6213f644d804 280 * this must be called again with an updated handle range to continue the discovery.
bogdanm 87:6213f644d804 281 *
bogdanm 87:6213f644d804 282 * @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
bogdanm 87:6213f644d804 283 * type BLE_UUID_TYPE_UNKNOWN will be received in the corresponding event.
bogdanm 87:6213f644d804 284 *
bogdanm 87:6213f644d804 285 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
bogdanm 87:6213f644d804 286 * @param[in] p_handle_range A pointer to the range of handles of the Service to perform this procedure on.
bogdanm 87:6213f644d804 287 *
bogdanm 87:6213f644d804 288 * @return @ref NRF_SUCCESS Successfully started or resumed the Characteristic Discovery procedure.
bogdanm 87:6213f644d804 289 * @return @ref BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
bogdanm 87:6213f644d804 290 * @return @ref NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
bogdanm 87:6213f644d804 291 * @return @ref NRF_ERROR_BUSY Client procedure already in progress.
bogdanm 87:6213f644d804 292 */
bogdanm 87:6213f644d804 293 SVCALL(SD_BLE_GATTC_CHARACTERISTICS_DISCOVER, uint32_t, sd_ble_gattc_characteristics_discover(uint16_t conn_handle, ble_gattc_handle_range_t const * const p_handle_range));
bogdanm 87:6213f644d804 294
bogdanm 87:6213f644d804 295
bogdanm 87:6213f644d804 296 /**@brief Initiate or continue a GATT Characteristic Descriptor Discovery procedure.
bogdanm 87:6213f644d804 297 *
bogdanm 87:6213f644d804 298 * @details This function initiates the Characteristic Descriptor discovery procedure. If the last Descriptor has not been reached,
bogdanm 87:6213f644d804 299 * this must be called again with an updated handle range to continue the discovery.
bogdanm 87:6213f644d804 300 *
bogdanm 87:6213f644d804 301 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
bogdanm 87:6213f644d804 302 * @param[in] p_handle_range A pointer to the range of handles of the Characteristic to perform this procedure on.
bogdanm 87:6213f644d804 303 *
bogdanm 87:6213f644d804 304 * @return @ref NRF_SUCCESS Successfully started or resumed the Descriptor Discovery procedure.
bogdanm 87:6213f644d804 305 * @return @ref BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
bogdanm 87:6213f644d804 306 * @return @ref NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
bogdanm 87:6213f644d804 307 * @return @ref NRF_ERROR_BUSY Client procedure already in progress.
bogdanm 87:6213f644d804 308 */
bogdanm 87:6213f644d804 309 SVCALL(SD_BLE_GATTC_DESCRIPTORS_DISCOVER, uint32_t, sd_ble_gattc_descriptors_discover(uint16_t conn_handle, ble_gattc_handle_range_t const * const p_handle_range));
bogdanm 87:6213f644d804 310
bogdanm 87:6213f644d804 311
bogdanm 87:6213f644d804 312 /**@brief Initiate or continue a GATT Read using Characteristic UUID procedure.
bogdanm 87:6213f644d804 313 *
bogdanm 87:6213f644d804 314 * @details This function initiates the Read using Characteristic UUID procedure. If the last Characteristic has not been reached,
bogdanm 87:6213f644d804 315 * this must be called again with an updated handle range to continue the discovery.
bogdanm 87:6213f644d804 316 *
bogdanm 87:6213f644d804 317 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
bogdanm 87:6213f644d804 318 * @param[in] p_uuid Pointer to a Characteristic value UUID to read.
bogdanm 87:6213f644d804 319 * @param[in] p_handle_range A pointer to the range of handles to perform this procedure on.
bogdanm 87:6213f644d804 320 *
bogdanm 87:6213f644d804 321 * @return @ref NRF_SUCCESS Successfully started or resumed the Read using Characteristic UUID procedure.
bogdanm 87:6213f644d804 322 * @return @ref BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
bogdanm 87:6213f644d804 323 * @return @ref NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
bogdanm 87:6213f644d804 324 * @return @ref NRF_ERROR_BUSY Client procedure already in progress.
bogdanm 87:6213f644d804 325 */
bogdanm 87:6213f644d804 326 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 * const p_uuid, ble_gattc_handle_range_t const * const p_handle_range));
bogdanm 87:6213f644d804 327
bogdanm 87:6213f644d804 328
bogdanm 87:6213f644d804 329 /**@brief Initiate or continue a GATT Read (Long) Characteristic or Descriptor procedure.
bogdanm 87:6213f644d804 330 *
bogdanm 87:6213f644d804 331 * @details This function initiates a GATT Read (Long) Characteristic or Descriptor procedure. If the Characteristic or Descriptor
bogdanm 87:6213f644d804 332 * to be read is longer than GATT_MTU - 1, this function must be called multiple times with appropriate offset to read the
bogdanm 87:6213f644d804 333 * complete value.
bogdanm 87:6213f644d804 334 *
bogdanm 87:6213f644d804 335 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
bogdanm 87:6213f644d804 336 * @param[in] handle The handle of the attribute to be read.
bogdanm 87:6213f644d804 337 * @param[in] offset Offset into the attribute value to be read.
bogdanm 87:6213f644d804 338 *
bogdanm 87:6213f644d804 339 * @return @ref NRF_SUCCESS Successfully started or resumed the Read (Long) procedure.
bogdanm 87:6213f644d804 340 * @return @ref BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
bogdanm 87:6213f644d804 341 * @return @ref NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
bogdanm 87:6213f644d804 342 * @return @ref NRF_ERROR_BUSY Client procedure already in progress.
bogdanm 87:6213f644d804 343 */
bogdanm 87:6213f644d804 344 SVCALL(SD_BLE_GATTC_READ, uint32_t, sd_ble_gattc_read(uint16_t conn_handle, uint16_t handle, uint16_t offset));
bogdanm 87:6213f644d804 345
bogdanm 87:6213f644d804 346
bogdanm 87:6213f644d804 347 /**@brief Initiate a GATT Read Multiple Characteristic Values procedure.
bogdanm 87:6213f644d804 348 *
bogdanm 87:6213f644d804 349 * @details This function initiates a GATT Read Multiple Characteristic Values procedure.
bogdanm 87:6213f644d804 350 *
bogdanm 87:6213f644d804 351 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
bogdanm 87:6213f644d804 352 * @param[in] p_handles A pointer to the handle(s) of the attribute(s) to be read.
bogdanm 87:6213f644d804 353 * @param[in] handle_count The number of handles in p_handles.
bogdanm 87:6213f644d804 354 *
bogdanm 87:6213f644d804 355 * @return @ref NRF_SUCCESS Successfully started the Read Multiple Characteristic Values procedure.
bogdanm 87:6213f644d804 356 * @return @ref BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
bogdanm 87:6213f644d804 357 * @return @ref NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
bogdanm 87:6213f644d804 358 * @return @ref NRF_ERROR_BUSY Client procedure already in progress.
bogdanm 87:6213f644d804 359 */
bogdanm 87:6213f644d804 360 SVCALL(SD_BLE_GATTC_CHAR_VALUES_READ, uint32_t, sd_ble_gattc_char_values_read(uint16_t conn_handle, uint16_t const * const p_handles, uint16_t handle_count));
bogdanm 87:6213f644d804 361
bogdanm 87:6213f644d804 362
bogdanm 87:6213f644d804 363 /**@brief Perform a Write (Characteristic Value or Descriptor, with or without response, signed or not, long or reliable) procedure.
bogdanm 87:6213f644d804 364 *
bogdanm 87:6213f644d804 365 * @details This function can perform all write procedures described in GATT.
bogdanm 87:6213f644d804 366 *
bogdanm 87:6213f644d804 367 * @note It is important to note that a write without response will <b>consume an application buffer</b>, and will therefore
bogdanm 87:6213f644d804 368 * generate a @ref BLE_EVT_TX_COMPLETE event when the packet has been transmitted. A write on the other hand will use the
bogdanm 87:6213f644d804 369 * standard client internal buffer and thus will only generate a @ref BLE_GATTC_EVT_WRITE_RSP event as soon as the write response
bogdanm 87:6213f644d804 370 * has been received from the peer. Please see the documentation of @ref sd_ble_tx_buffer_count_get for more details.
bogdanm 87:6213f644d804 371 *
bogdanm 87:6213f644d804 372 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
bogdanm 87:6213f644d804 373 * @param[in] p_write_params A pointer to a write parameters structure.
bogdanm 87:6213f644d804 374 *
bogdanm 87:6213f644d804 375 * @return @ref NRF_SUCCESS Successfully started the Write procedure.
bogdanm 87:6213f644d804 376 * @return @ref BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
bogdanm 87:6213f644d804 377 * @return @ref NRF_ERROR_INVALID_ADDR Invalid pointer supplied.
bogdanm 87:6213f644d804 378 * @return @ref NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied.
bogdanm 87:6213f644d804 379 * @return @ref NRF_ERROR_DATA_SIZE Invalid data size(s) supplied.
bogdanm 87:6213f644d804 380 * @return @ref NRF_ERROR_BUSY Procedure already in progress.
bogdanm 87:6213f644d804 381 * @return @ref BLE_ERROR_NO_TX_BUFFERS There are no available buffers left.
bogdanm 87:6213f644d804 382 */
bogdanm 87:6213f644d804 383 SVCALL(SD_BLE_GATTC_WRITE, uint32_t, sd_ble_gattc_write(uint16_t conn_handle, ble_gattc_write_params_t const * const p_write_params));
bogdanm 87:6213f644d804 384
bogdanm 87:6213f644d804 385
bogdanm 87:6213f644d804 386 /**@brief Send a Handle Value Confirmation to the GATT Server.
bogdanm 87:6213f644d804 387 *
bogdanm 87:6213f644d804 388 * @param[in] conn_handle The connection handle identifying the connection to perform this procedure on.
bogdanm 87:6213f644d804 389 * @param[in] handle The handle of the attribute in the indication.
bogdanm 87:6213f644d804 390 *
bogdanm 87:6213f644d804 391 * @return @ref NRF_SUCCESS Successfully queued the Handle Value Confirmation for transmission.
bogdanm 87:6213f644d804 392 * @return @ref BLE_ERROR_INVALID_CONN_HANDLE Invalid Connection Handle.
bogdanm 87:6213f644d804 393 * @return @ref NRF_ERROR_INVALID_STATE No Indication pending to be confirmed.
bogdanm 87:6213f644d804 394 * @return @ref BLE_ERROR_INVALID_ATTR_HANDLE Invalid attribute handle.
bogdanm 87:6213f644d804 395 * @return @ref BLE_ERROR_NO_TX_BUFFERS There are no available buffers left.
bogdanm 87:6213f644d804 396 */
bogdanm 87:6213f644d804 397 SVCALL(SD_BLE_GATTC_HV_CONFIRM, uint32_t, sd_ble_gattc_hv_confirm(uint16_t conn_handle, uint16_t handle));
bogdanm 87:6213f644d804 398
bogdanm 87:6213f644d804 399 /** @} */
bogdanm 87:6213f644d804 400
bogdanm 87:6213f644d804 401 #endif /* BLE_GATTC_H__ */
bogdanm 87:6213f644d804 402
bogdanm 87:6213f644d804 403 /**
bogdanm 87:6213f644d804 404 @}
bogdanm 87:6213f644d804 405 @}
bogdanm 87:6213f644d804 406 */