ble_enh_prf.h
Go to the documentation of this file.
1 /**
2 ****************************************************************************************
3 *
4 * @file ble_enh_prf.h
5 *
6 * @brief BLE PRF ENHANCED API
7 *
8 ****************************************************************************************
9 * @attention
10 #####Copyright (c) 2019 GOODIX
11 All rights reserved.
12
13 Redistribution and use in source and binary forms, with or without
14 modification, are permitted provided that the following conditions are met:
15 * Redistributions of source code must retain the above copyright
16 notice, this list of conditions and the following disclaimer.
17 * Redistributions in binary form must reproduce the above copyright
18 notice, this list of conditions and the following disclaimer in the
19 documentation and/or other materials provided with the distribution.
20 * Neither the name of GOODIX nor the names of its contributors may be used
21 to endorse or promote products derived from this software without
22 specific prior written permission.
23
24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
28 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 POSSIBILITY OF SUCH DAMAGE.
35 *****************************************************************************************
36 */
37
38 /**
39 * @addtogroup BLE
40 * @{
41 */
42
43 /**
44 @addtogroup BLE_PRF Profile
45 @{
46 @brief Definitions and prototypes for the profile interface.
47 */
48
49 #ifndef __BLE_ENH_PRF_H__
50 #define __BLE_ENH_PRF_H__
51
52 #include "ble_error.h"
53 #include "ble_att.h"
54 #include "ble_gatts.h"
55 #include "ble_gattc.h"
56 #include "ble_gatt.h"
57 #include "ble_event.h"
58
59 /**
60 @addtogroup BLE_PRF_SERVER Profile Server
61 @{
62 @brief Definitions and prototypes for Profile Server interface.
63 */
64
65 /** @addtogroup BLE_PRF_SERVER_STRUCTURES Structures
66 * @{ */
67
68
69 /** @} */
70
71 /** @addtogroup BLE_PRF_FUNCTIONS Functions
72 * @{ */
73
74 /**
75 ****************************************************************************************
76 * @brief Add a server profile by providing its detailed information, including manager callback functions and GATT server callback functions.
77 * This API should be called in application initialization function.
78 *
79 * @param[in] p_gatts_db: Pointer to the database info. See @ref ble_gatts_create_db_t.
80 * @param[in] evt_handler: Event handler. See @ref ble_evt_handler_t.
81 *
82 * @note If there are several profiles which need to be added, this function should be called corresponding times.
83 *
84 * @retval ::SDK_SUCCESS: The profile info is recorded successfully, and the database will be created in profile initialization callback function.
85 * @retval ::SDK_ERR_POINTER_NULL: The parameter prf_info is NULL, or input parameters that prf_info points to are invalid.
86 * @retval ::SDK_ERR_NO_RESOURCES: The profile number is up to the maximum number the system can support.
87 ****************************************************************************************
88 */
89 uint16_t ble_gatts_enh_prf_add(ble_gatts_create_db_t *p_gatts_db, ble_evt_handler_t evt_handler);
90
91 /**
92 ****************************************************************************************
93 * @brief Respond to an attribute read request. It is used in gatts event handle function @ref BLE_GATTS_EVT_ENH_READ_REQUEST
94 * to send attribute value to stack which is saved in user space.
95 *
96 * @note The status member ble_gatts_read_cfm_t::status should be set to @ref BLE_ATT_ERR_INSUFF_AUTHOR
97 * to control the authorization of particular read operations of a client.
98 *
99 * @param[in] conn_idx: Current connection index.
100 * @param[in] cid: The local channel ID.
101 * @param[in] p_param: Pointer to the parameters filled by profile. See @ref ble_gatts_read_cfm_t.
102 *
103 * @retval ::SDK_SUCCESS: Send read confirm value to stack successfully.
104 * @retval ::SDK_ERR_POINTER_NULL: Param is NULL.
105 * @retval ::SDK_ERR_INVALID_CONN_IDX: Conidx is invalid.
106 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
107 ****************************************************************************************
108 */
109 uint16_t ble_gatts_enh_read_cfm(uint8_t conn_idx, uint16_t cid, const ble_gatts_read_cfm_t *p_param);
110
111 /**
112 ****************************************************************************************
113 * @brief Respond to an attribute write request. It is used in gatts event handler function
114 * @ref BLE_GATTS_EVT_ENH_WRITE_REQUEST to send write operation status to stack.
115 *
116 * @note The status member ble_gatts_write_cfm_t::status should be set to @ref BLE_ATT_ERR_INSUFF_AUTHOR
117 * to control the authorization of particular client's write operation.
118 *
119 * @param[in] conn_idx: Current connection index.
120 * @param[in] cid: The local channel ID.
121 * @param[in] p_param: Pointer to the parameters filled by profile. see @ref ble_gatts_write_cfm_t.
122 *
123 * @retval ::SDK_SUCCESS: Send write confirm status to stack successfully.
124 * @retval ::SDK_ERR_POINTER_NULL: Param is NULL.
125 * @retval ::SDK_ERR_INVALID_CONN_IDX: Conidx is invalid.
126 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
127 ****************************************************************************************
128 */
129 uint16_t ble_gatts_enh_write_cfm(uint8_t conn_idx, uint16_t cid, const ble_gatts_write_cfm_t *p_param);
130
131 /**
132 ****************************************************************************************
133 * @brief Respond to an attribute prepare write request. It is used in gatts event handler
134 * function @ref BLE_GATTS_EVT_ENH_PREP_WRITE_REQUEST to send prepare write operation status to stack.
135 *
136 * @note The status member ble_gatts_prep_write_cfm_t::status should be set to @ref BLE_ATT_ERR_INSUFF_AUTHOR
137 * to control the authorization of particular client's write operation.
138 *
139 * @param[in] conn_idx: Current connection index.
140 * @param[in] cid: The local channel ID.
141 * @param[in] p_param: Pointer to the parameters filled by profile. see @ref ble_gatts_prep_write_cfm_t.
142 *
143 * @retval ::SDK_SUCCESS: Send prepare write confirm status to stack successfully.
144 * @retval ::SDK_ERR_POINTER_NULL: Param is NULL.
145 * @retval ::SDK_ERR_INVALID_CONN_IDX: Conidx is invalid.
146 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
147 ****************************************************************************************
148 */
149 uint16_t ble_gatts_enh_prepare_write_cfm(uint8_t conn_idx, uint16_t cid, const ble_gatts_prep_write_cfm_t *p_param);
150
151 /**
152 ****************************************************************************************
153 * @brief Send out a notification or an indication. The execution status of sending notification or
154 * indication will be retrieved in the event @ref BLE_GATTS_EVT_ENH_NTF_IND.
155 *
156 * @note Check whether the relevant Client Characteristic Configuration Descriptor is enabled before using this API.
157 *
158 * @param[in] conn_idx: Current connection index.
159 * @param[in] cid: The local channel ID.
160 * @param[in] p_param: Pointer to the parameters filled by profile. see @ref ble_gatts_noti_ind_t.
161 *
162 * @retval ::SDK_SUCCESS: Send Notification or Indication event to stack successfully.
163 * @retval ::SDK_ERR_POINTER_NULL: Param is NULL.
164 * @retval ::SDK_ERR_INVALID_CONN_IDX: Conidx is invalid.
165 * @retval ::SDK_ERR_INVALID_PARAM: Type is invalid.
166 * @retval ::SDK_ERR_INVALID_HANDLE: Handle not exist in the database.
167 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
168 ****************************************************************************************
169 */
170 uint16_t ble_gatts_enh_noti_ind(uint8_t conn_idx, uint16_t cid, const ble_gatts_noti_ind_t *p_param);
171
172
173 /**
174 ****************************************************************************************
175 * @brief Send out Multiple Variable Length Notifications. The execution status of sending notification or
176 * indication will be retrieved in the event @ref BLE_GATTS_EVT_ENH_MULT_NTF
177 *
178 * @note Check whether the relevant Client Characteristic Configuration Descriptor is enabled before using this API.
179 *
180 * @param[in] conn_idx: Current connection index.
181 * @param[in] cid: The local channel ID.
182 * @param[in] p_param: Pointer to the parameters filled by profile. see @ref ble_gatts_noti_multiple_t.
183 *
184 * @retval ::SDK_SUCCESS: Send Notification or Indication event to stack successfully.
185 * @retval ::SDK_ERR_POINTER_NULL: Param is NULL.
186 * @retval ::SDK_ERR_INVALID_CONN_IDX: Conidx is invalid.
187 * @retval ::SDK_ERR_INVALID_PARAM: Type is invalid.
188 * @retval ::SDK_ERR_INVALID_HANDLE: Handle not exist in the database.
189 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
190 ****************************************************************************************
191 */
192 uint16_t ble_gatts_enh_mult_noti(uint8_t conn_idx, uint16_t cid, const ble_gatts_noti_multiple_t *p_param);
193 /** @} */
194
195 /**
196 @addtogroup BLE_PRF_CLIENT Profile Client
197 @{
198 @brief Definitions and prototypes for Profile Client interface.
199 */
200 /**
201 @addtogroup BLE_PRF_CLIENT_FUNCTIONS Functions
202 @{
203 @brief Definitions and prototypes for Profile Client interface.
204 */
205 /**
206 ****************************************************************************************
207 * @brief Add a client profile by providing its detail information, including manager callback functions and GATT client callback functions.
208 * This API should be called in application initialization function.
209 *
210 * @param[in] evt_handler: Event handler, see @ref ble_evt_handler_t.
211 * @param[out] p_client_prf_id: Pointer to the client profile id.
212 *
213 * @note If there are several profiles which need to be added, this function should be called corresponding times.
214 *
215 * @retval ::SDK_SUCCESS: The profile info is recorded successfully, and the profile ENV will be initialized in profile initialization callback function.
216 * @retval ::SDK_ERR_POINTER_NULL: The parameter p_client_prf_info or p_client_prf_id is NULL, or input parameters that prf_info points to are invalid.
217 * @retval ::SDK_ERR_NO_RESOURCES: The profile number is up to the maximum number the system can support.
218 ****************************************************************************************
219 */
220 uint16_t ble_gattc_prf_enh_add(uint8_t *p_client_prf_id, ble_evt_handler_t evt_handler);
221 /**
222 ****************************************************************************************
223 * @brief Profile client Browse Specific Primary Service information on remote GATT server.
224 *
225 * @note This discovery automatically searches for Primary Services, Included Services, Characteristics and Descriptors of each service.
226 * To discover one or more services only, use ble_gattc_primary_services_discover() instead.
227 * This discovery is able to search a specific Primary Service.
228 * If srvc_uuid is NULL, all services are returned.
229 *
230 * @note Event @ref BLE_GATTC_EVT_SRVC_BROWSE will be called for all attributes of each service found.
231 * After completed service handle range registeration for receiving peer device indication/notification will be executed internally.
232 * Because secondary service can't be browsed, so handle range registeration for receiving peer device indication/notification to this client
233 * profile may be necessary. App can call function ble_gattc_prf_evt_handle_register for registeration, it depends on user app.
234 * If user don't call this function, user shall call ble_gattc_prf_evt_handle_register to register handle range for receiving
235 * peer device indication/notification in specific client profile callback.
236 *
237 *
238 * @param[in] prf_id: Profile id.
239 * @param[in] conn_idx: Current connection index.
240 * @param[in] cid: The local channel ID.
241 * @param[in] p_srvc_uuid: Pointer to Service UUID. If it is NULL, all services will be returned.
242 *
243 * @retval ::SDK_SUCCESS: Successfully start the Browse Service(s) procedure.
244 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter(s) supplied.
245 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
246 * @retval ::SDK_ERR_INVALID_CID: Invalid CID supplied.
247 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
248 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
249 ****************************************************************************************
250 */
251 uint16_t ble_gattc_enh_prf_services_browse(uint8_t prf_id, uint8_t conn_idx, uint16_t cid, const ble_uuid_t *p_srvc_uuid);
252
253 /**
254 ****************************************************************************************
255 * @brief Profile client Discover Primary Services on remote GATT server.
256 *
257 * @note Event @ref BLE_GATTC_EVT_PRIMARY_SRVC_DISC will be called for service(s) found.
258 *
259 * @param[in] prf_id: Profile id.
260 * @param[in] conn_idx: Current connection index.
261 * @param[in] cid: The local channel ID.
262 * @param[in] p_srvc_uuid: Pointer to Service UUID. If it is NULL, all Primary Services will be returned.
263 *
264 * @retval ::SDK_SUCCESS: Successfully start the Primary Service Discovery procedure.
265 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter(s) supplied.
266 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
267 * @retval ::SDK_ERR_INVALID_CID: Invalid CID supplied.
268 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
269 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
270 ****************************************************************************************
271 */
272 uint16_t ble_gattc_enh_prf_primary_services_discover(uint8_t prf_id, uint8_t conn_idx, uint16_t cid, const ble_uuid_t *p_srvc_uuid);
273
274 /**
275 ****************************************************************************************
276 * @brief Profile client Discover Included Services on remote GATT server.
277 *
278 * @note Event @ref BLE_GATTC_EVT_INCLUDE_SRVC_DISC will be called for Included Service(s) found.
279 *
280 * @param[in] prf_id: Profile id.
281 * @param[in] conn_idx: Current connection index.
282 * @param[in] cid: The local channel ID.
283 * @param[in] start_hdl: Start handle.
284 * @param[in] end_hdl: End handle.
285 *
286 * @retval ::SDK_SUCCESS: Successfully start the Relationship Discovery procedure.
287 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter(s) supplied.
288 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
289 * @retval ::SDK_ERR_INVALID_CID: Invalid CID supplied.
290 * @retval ::SDK_ERR_INVALID_HANDLE: Invalid handle supplied.
291 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
292 ****************************************************************************************
293 */
294 uint16_t ble_gattc_enh_prf_included_services_discover(uint8_t prf_id, uint8_t conn_idx, uint16_t cid, uint16_t start_hdl, uint16_t end_hdl);
295
296 /**
297 ****************************************************************************************
298 * @brief Profile client Discover Characteristics on remote GATT server.
299 * @note Event @ref BLE_GATTC_EVT_CHAR_DISC will be called for Characteristic Declaration(s) found.
300 * If p_disc_char is NULL, the invalid pointer error code will be returned immediately.
301 *
302 * @param[in] prf_id: Profile id.
303 * @param[in] conn_idx: Current connection index.
304 * @param[in] cid: The local channel ID.
305 * @param[in] p_disc_char: Pointer to discover by characteristic UUID info. If it's p_uuid member is NULL, all characteristics are returned.
306 *
307 * @retval ::SDK_SUCCESS: Successfully start the Characteristic Discovery procedure.
308 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter(s) supplied.
309 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
310 * @retval ::SDK_ERR_INVALID_CID: Invalid CID supplied.
311 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
312 * @retval ::SDK_ERR_INVALID_HANDLE: Invalid handle supplied.
313 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
314 ****************************************************************************************
315 */
316 uint16_t ble_gattc_enh_prf_char_discover(uint8_t prf_id, uint8_t conn_idx, uint16_t cid, ble_gattc_disc_char_t *p_disc_char);
317
318 /**
319 ****************************************************************************************
320 * @brief Profile client Discover Characteristics Descriptors on remote GATT server.
321 *
322 * @note Event @ref BLE_GATTC_EVT_CHAR_DESC_DISC will be called for Characteristic Descriptor(s) found.
323 * If the last Descriptor has not been reached, this function must be called again with an updated handle range to continue the discovery.
324 *
325 * @param[in] prf_id: Profile id.
326 * @param[in] conn_idx: Current connection index.
327 * @param[in] cid: The local channel ID.
328 * @param[in] start_hdl: Start handle.
329 * @param[in] end_hdl: End handle.
330 *
331 * @retval ::SDK_SUCCESS: Successfully start the Descriptor Discovery procedure.
332 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter(s) supplied.
333 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
334 * @retval ::SDK_ERR_INVALID_CID: Invalid CID supplied.
335 * @retval ::SDK_ERR_INVALID_HANDLE: Invalid handle supplied.
336 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
337 ****************************************************************************************
338 */
339 uint16_t ble_gattc_enh_prf_char_desc_discover(uint8_t prf_id, uint8_t conn_idx, uint16_t cid, uint16_t start_hdl, uint16_t end_hdl);
340
341 /**
342 ****************************************************************************************
343 * @brief Profile client Read Attribute from remote GATT server.
344 *
345 * @note This uses either the "Read Characteristic Value" procedure or the "Read Characteristic Descriptor"
346 * procedure, depending on the attribute pointed by handle. If offset is non-zero or the
347 * attribute length is larger than the MTU, the "Read Long Characteristic Value" procedure or the
348 * "Read Long Characteristic Descriptor" procedure will be used respectively.
349 *
350 * @note Event @ref BLE_GATTC_EVT_READ_RSP will be called when Read is finished.
351 *
352 * @param[in] prf_id: Profile id.
353 * @param[in] conn_idx: Current connection index.
354 * @param[in] cid: The local channel ID.
355 * @param[in] handle: Attribute handle.
356 * @param[in] offset: Value offset to start with.
357 *
358 * @retval ::SDK_SUCCESS: Successfully start the Read (Long) procedure.
359 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter(s) supplied.
360 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
361 * @retval ::SDK_ERR_INVALID_CID: Invalid CID supplied.
362 * @retval ::SDK_ERR_INVALID_HANDLE: Invalid handle supplied.
363 * @retval ::SDK_ERR_INVALID_OFFSET: Offset exceeds the current attribute value length.
364 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
365 ****************************************************************************************
366 */
367 uint16_t ble_gattc_enh_prf_read(uint8_t prf_id, uint8_t conn_idx, uint16_t cid, uint16_t handle, uint16_t offset);
368
369 /**
370 ****************************************************************************************
371 * @brief Profile client Read Attribute by UUID.
372 *
373 * @note Event @ref BLE_GATTC_EVT_READ_RSP will be called when Read is finished.
374 *
375 * @param[in] prf_id: Profile id.
376 * @param[in] conn_idx: Current connection index.
377 * @param[in] cid: The local channel ID.
378 * @param[in] p_read_by_uuid: Pointer to Read by Characteristic UUID info.
379 *
380 * @retval ::SDK_SUCCESS: Successfully start the Read Using Characteristic UUID procedure.
381 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter(s) supplied.
382 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
383 * @retval ::SDK_ERR_INVALID_CID: Invalid CID supplied.
384 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
385 * @retval ::SDK_ERR_INVALID_HANDLE: Invalid handle supplied.
386 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
387 ****************************************************************************************
388 */
389 uint16_t ble_gattc_enh_prf_read_by_uuid(uint8_t prf_id, uint8_t conn_idx, uint16_t cid, ble_gattc_read_by_uuid_t *p_read_by_uuid);
390
391 /**
392 ****************************************************************************************
393 * @brief Profile client Initiate a Read Multiple Characteristic Values procedure
394 *
395 * @note Event @ref BLE_GATTC_EVT_READ_RSP will be called for each handle value which is read.
396 * If set handle len 0, a Read Multiple Variable Length Characteristic Values procedure will be Initiated, this procesure is only
397 * support on version >= 5.2.
398 *
399 * @param[in] prf_id: Profile id.
400 * @param[in] conn_idx: Current connection index.
401 * @param[in] cid: The local channel ID.
402 * @param[in] p_param: Pointer to the parameters of the value.
403 *
404 * @note Event @ref BLE_GATTC_EVT_READ_RSP will be called when Read is finished.
405 * If set handle len 0, a Read Multiple Variable Length Characteristic Values procedure will be Initiated.
406 *
407 * @retval ::SDK_SUCCESS: Successfully start the Read Multiple Characteristic Values procedure.
408 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter(s) supplied.
409 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
410 * @retval ::SDK_ERR_INVALID_CID: Invalid CID supplied.
411 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
412 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
413 ****************************************************************************************
414 */
415 uint16_t ble_gattc_enh_prf_read_multiple(uint8_t prf_id, uint8_t conn_idx, uint16_t cid, const ble_gattc_read_multiple_t *p_param);
416
417
418 /**
419 ****************************************************************************************
420 * @brief Profile client Write (Long) Characteristic (Descriptor) Value.
421 *
422 * @note This uses either the "Write Characteristic Value" procedure or the "Write Characteristic
423 * Descriptor" procedure, depending on the attribute pointed by handle. If offset is non-zero
424 * or the attribute length is larger than the MTU, the "Write Long Characteristic Value" procedure
425 * or the "Write Long Characteristic Descriptor" procedure will be used respectively.
426 *
427 * @note Once completed event @ref BLE_GATTC_EVT_WRITE_RSP will be called.
428 *
429 * @param[in] prf_id: Profile id.
430 * @param[in] conn_idx: Current connection index.
431 * @param[in] cid: The local channel ID.
432 * @param[in] p_write_attr_value: Pointer to the write attribue value info.
433 *
434 * @retval ::SDK_SUCCESS: Successfully start the Write procedure.
435 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter(s) supplied.
436 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
437 * @retval ::SDK_ERR_INVALID_CID: Invalid CID supplied.
438 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
439 * @retval ::SDK_ERR_INVALID_HANDLE: Invalid handle supplied.
440 * @retval ::SDK_ERR_INVALID_OFFSET: Offset exceeds the current attribute value length.
441 * @retval ::SDK_ERR_INVALID_DATA_LENGTH: Invalid data length supplied.
442 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
443 ****************************************************************************************
444 */
445 uint16_t ble_gattc_enh_prf_write(uint8_t prf_id, uint8_t conn_idx, uint16_t cid, ble_gattc_write_attr_value_t *p_write_attr_value);
446
447 /**
448 ****************************************************************************************
449 * @brief Profile client Prepare Long/Reliable Write to remote GATT server.
450 * @note Once completed event @ref BLE_GATTC_EVT_WRITE_RSP will be called.
451 *
452 * @param[in] prf_id: Profile id.
453 * @param[in] conn_idx: Current connection index.
454 * @param[in] cid: The local channel ID.
455 * @param[in] p_write_attr_value: Pointer to the write attribue value info.
456 *
457 * @retval ::SDK_SUCCESS: Successfully start the Write procedure.
458 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter(s) supplied.
459 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
460 * @retval ::SDK_ERR_INVALID_CID: Invalid CID supplied.
461 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
462 * @retval ::SDK_ERR_INVALID_HANDLE: Invalid handle supplied.
463 * @retval ::SDK_ERR_INVALID_OFFSET: Offset exceeds the current attribute value length.
464 * @retval ::SDK_ERR_INVALID_DATA_LENGTH: Invalid data length supplied.
465 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
466 ****************************************************************************************
467 */
468 uint16_t ble_gattc_enh_prf_write_prepare(uint8_t prf_id, uint8_t conn_idx, uint16_t cid, ble_gattc_write_attr_value_t *p_write_attr_value);
469
470 /**
471 ****************************************************************************************
472 * @brief Profile client Execute Reliable/Long Write to remote GATT server.
473 *
474 * @note Once completed event @ref BLE_GATTC_EVT_WRITE_RSP will be called.
475 *
476 * @param[in] prf_id: Profile id.
477 * @param[in] conn_idx: Current connection index.
478 * @param[in] cid: The local channel ID.
479 * @param[in] execute: True if data shall be written; False if cancel all prepared writes.
480 *
481 * @retval ::SDK_SUCCESS: Successfully send an Execute Write request.
482 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter(s) supplied.
483 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
484 * @retval ::SDK_ERR_INVALID_CID: Invalid CID supplied.
485 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
486 ****************************************************************************************
487 */
488 uint16_t ble_gattc_enh_prf_write_execute(uint8_t prf_id, uint8_t conn_idx, uint16_t cid, bool execute);
489
490 /**
491 ****************************************************************************************
492 * @brief Profile client Write Attribute to remote GATT server (without response).
493 *
494 * @note Whatever signed_write is set, Write Without Response sub-procedure is always used, because the Signed Write Without Response
495 * sub-procedure shall only be supported on the LE Fixed Channel Unenhanced ATT bearer.
496 *
497 * @note Once completed event @ref BLE_GATTC_EVT_WRITE_RSP will be called.
498 *
499 * @param[in] prf_id: Profile id.
500 * @param[in] conn_idx: Current connection index.
501 * @param[in] cid: The local channel ID.
502 * @param[in] p_write_no_resp: Pointer to the write without response info.
503 *
504 * @retval ::SDK_SUCCESS Successfully: start the Write Without Response procedure.
505 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter(s) supplied.
506 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
507 * @retval ::SDK_ERR_INVALID_CID: Invalid CID supplied.
508 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
509 * @retval ::SDK_ERR_INVALID_HANDLE: Invalid handle supplied.
510 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
511
512 ****************************************************************************************
513 */
514 uint16_t ble_gattc_enh_prf_write_no_resp(uint8_t prf_id, uint8_t conn_idx, uint16_t cid, ble_gattc_write_no_resp_t *p_write_no_resp);
515
516 /**
517 ****************************************************************************************
518 * @brief Profile client Confirm Reception of Indication.
519 *
520 * @note Confirm indication which has been correctly received from the peer.
521 *
522 * @param[in] prf_id Profile id.
523 * @param[in] conn_idx: Current connection index.
524 * @param[in] cid: The local channel ID.
525 * @param[in] handle: Value handle.
526 *
527 * @retval ::SDK_SUCCESS: Successfully send a Confirm Reception of Indication request.
528 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter(s) supplied.
529 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
530 * @retval ::SDK_ERR_INVALID_CID: Invalid CID supplied.
531 * @retval ::SDK_ERR_INVALID_HANDLE: Invalid handle supplied.
532 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
533 ****************************************************************************************
534 */
535 uint16_t ble_gattc_enh_prf_indicate_cfm(uint8_t prf_id, uint8_t conn_idx, uint16_t cid, uint16_t handle);
536
537 /** @} */
538 /** @} */
539
540 #endif
541
542 /** @} */
543 /** @} */
544 /** @} */
ble_gattc_enh_prf_char_discover
uint16_t ble_gattc_enh_prf_char_discover(uint8_t prf_id, uint8_t conn_idx, uint16_t cid, ble_gattc_disc_char_t *p_disc_char)
Profile client Discover Characteristics on remote GATT server.
ble_gattc_enh_prf_indicate_cfm
uint16_t ble_gattc_enh_prf_indicate_cfm(uint8_t prf_id, uint8_t conn_idx, uint16_t cid, uint16_t handle)
Profile client Confirm Reception of Indication.
ble_gattc_enh_prf_included_services_discover
uint16_t ble_gattc_enh_prf_included_services_discover(uint8_t prf_id, uint8_t conn_idx, uint16_t cid, uint16_t start_hdl, uint16_t end_hdl)
Profile client Discover Included Services on remote GATT server.
ble_gattc_enh_prf_char_desc_discover
uint16_t ble_gattc_enh_prf_char_desc_discover(uint8_t prf_id, uint8_t conn_idx, uint16_t cid, uint16_t start_hdl, uint16_t end_hdl)
Profile client Discover Characteristics Descriptors on remote GATT server.
ble_gatts_enh_noti_ind
uint16_t ble_gatts_enh_noti_ind(uint8_t conn_idx, uint16_t cid, const ble_gatts_noti_ind_t *p_param)
Send out a notification or an indication.
ble_gatts_write_cfm_t
GATT write attribute result description.
Definition: ble_gatts.h:315
ble_gatts_create_db_t
Parameter of Added service description.
Definition: ble_gatts.h:283
ble_gatts.h
BLE GATTS API.
ble_gattc_enh_prf_primary_services_discover
uint16_t ble_gattc_enh_prf_primary_services_discover(uint8_t prf_id, uint8_t conn_idx, uint16_t cid, const ble_uuid_t *p_srvc_uuid)
Profile client Discover Primary Services on remote GATT server.
ble_gatts_noti_ind_t
GATT sending Notification or Indication event param description.
Definition: ble_gatts.h:335
ble_gatt.h
BLE GATT.
ble_gattc_enh_prf_services_browse
uint16_t ble_gattc_enh_prf_services_browse(uint8_t prf_id, uint8_t conn_idx, uint16_t cid, const ble_uuid_t *p_srvc_uuid)
Profile client Browse Specific Primary Service information on remote GATT server.
ble_gattc_write_no_resp_t
GATTC write without response structure.
Definition: ble_gattc.h:141
ble_gatts_enh_write_cfm
uint16_t ble_gatts_enh_write_cfm(uint8_t conn_idx, uint16_t cid, const ble_gatts_write_cfm_t *p_param)
Respond to an attribute write request.
ble_gattc_enh_prf_write
uint16_t ble_gattc_enh_prf_write(uint8_t prf_id, uint8_t conn_idx, uint16_t cid, ble_gattc_write_attr_value_t *p_write_attr_value)
Profile client Write (Long) Characteristic (Descriptor) Value.
ble_error.h
File that contains error codes.
ble_gattc_enh_prf_read
uint16_t ble_gattc_enh_prf_read(uint8_t prf_id, uint8_t conn_idx, uint16_t cid, uint16_t handle, uint16_t offset)
Profile client Read Attribute from remote GATT server.
ble_event.h
BLE event header files.
ble_gatts_enh_read_cfm
uint16_t ble_gatts_enh_read_cfm(uint8_t conn_idx, uint16_t cid, const ble_gatts_read_cfm_t *p_param)
Respond to an attribute read request.
ble_gattc_write_attr_value_t
GATTC write attribute value structure.
Definition: ble_gattc.h:130
ble_gattc_enh_prf_read_by_uuid
uint16_t ble_gattc_enh_prf_read_by_uuid(uint8_t prf_id, uint8_t conn_idx, uint16_t cid, ble_gattc_read_by_uuid_t *p_read_by_uuid)
Profile client Read Attribute by UUID.
ble_gattc_enh_prf_write_execute
uint16_t ble_gattc_enh_prf_write_execute(uint8_t prf_id, uint8_t conn_idx, uint16_t cid, bool execute)
Profile client Execute Reliable/Long Write to remote GATT server.
ble_gattc_read_by_uuid_t
GATTC read by characteristic UUID structure.
Definition: ble_gattc.h:120
ble_gatts_enh_prf_add
uint16_t ble_gatts_enh_prf_add(ble_gatts_create_db_t *p_gatts_db, ble_evt_handler_t evt_handler)
Add a server profile by providing its detailed information, including manager callback functions and ...
ble_gatts_enh_mult_noti
uint16_t ble_gatts_enh_mult_noti(uint8_t conn_idx, uint16_t cid, const ble_gatts_noti_multiple_t *p_param)
Send out Multiple Variable Length Notifications.
ble_att.h
Attribute Protocol.
ble_evt_handler_t
void(* ble_evt_handler_t)(const ble_evt_t *p_evt)
The BLE event handler type.
Definition: ble_event.h:244
ble_gatts_prep_write_cfm_t
GATT prepare write result description.
Definition: ble_gatts.h:324
ble_gatts_noti_multiple_t
GATTCS Multiple Notification.
Definition: ble_gatts.h:354
ble_gattc.h
BLE GATTC API.
ble_gattc_enh_prf_write_no_resp
uint16_t ble_gattc_enh_prf_write_no_resp(uint8_t prf_id, uint8_t conn_idx, uint16_t cid, ble_gattc_write_no_resp_t *p_write_no_resp)
Profile client Write Attribute to remote GATT server (without response).
ble_gattc_enh_prf_write_prepare
uint16_t ble_gattc_enh_prf_write_prepare(uint8_t prf_id, uint8_t conn_idx, uint16_t cid, ble_gattc_write_attr_value_t *p_write_attr_value)
Profile client Prepare Long/Reliable Write to remote GATT server.
ble_uuid_t
GATT UUID structure.
Definition: ble_gatt.h:81
ble_gatts_enh_prepare_write_cfm
uint16_t ble_gatts_enh_prepare_write_cfm(uint8_t conn_idx, uint16_t cid, const ble_gatts_prep_write_cfm_t *p_param)
Respond to an attribute prepare write request.
ble_gattc_enh_prf_read_multiple
uint16_t ble_gattc_enh_prf_read_multiple(uint8_t prf_id, uint8_t conn_idx, uint16_t cid, const ble_gattc_read_multiple_t *p_param)
Profile client Initiate a Read Multiple Characteristic Values procedure.
ble_gattc_read_multiple_t
GATTC Read Multiple.
Definition: ble_gattc.h:157
ble_gatts_read_cfm_t
GATT read attribute result description.
Definition: ble_gatts.h:304
ble_gattc_prf_enh_add
uint16_t ble_gattc_prf_enh_add(uint8_t *p_client_prf_id, ble_evt_handler_t evt_handler)
Add a client profile by providing its detail information, including manager callback functions and GA...
ble_gattc_disc_char_t
GATTC discovery characteristic structure.
Definition: ble_gattc.h:110