mbed library sources

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Fri Oct 17 14:15:08 2014 +0100
Revision:
357:d73ca02bc818
Parent:
targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/Lib/s110_nrf51822_7_0_0/s110_nrf51822_7.0.0_API/include/ble_gattc.h@277:0dffe5d9e928
Synchronized with git revision 74cc430faad92b2df0cd91d78a074ec315ad7533

Full URL: https://github.com/mbedmicro/mbed/commit/74cc430faad92b2df0cd91d78a074ec315ad7533/

updating to v7.1.0 of the Nordic soft-device.

Who changed what in which revision?

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