ble_prf.h
Go to the documentation of this file.
1 /**
2  ****************************************************************************************
3  *
4  * @file ble_prf.h
5  *
6  * @brief BLE PRF 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_PRF_H__
50 #define __BLE_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 /** @addtogroup BLE_PRF_FUNCTIONS Functions
60 * @{ */
61 
62 /**
63  ****************************************************************************************
64  * @brief Add a server profile by providing its detailed information..
65  *
66  * @param[in] p_gatts_db: Pointer to the prf_info. See @ref ble_gatts_create_db_t.
67  * @param[in] evt_handler: Pointer to ble events handler.
68  *
69  * @retval ::SDK_SUCCESS: The profile info is recorded successfully, and the database will be created in profile initialization callback function.
70  * @retval ::SDK_ERR_POINTER_NULL: The parameter p_gatts_db or evt_handler is NULL.
71  * @retval ::SDK_ERR_NO_RESOURCES: The profile number is up to the maximum number the system can support.
72  ****************************************************************************************
73  */
74 uint16_t ble_gatts_prf_add(ble_gatts_create_db_t *p_gatts_db, ble_evt_handler_t evt_handler);
75 
76 /**
77  ****************************************************************************************
78  * @brief Add a client profile by providing its detail information.
79  *
80  * @param[in] p_uuid: Pointer to the target service uuid. See @ref ble_uuid_t.
81  * @param[out] evt_handler: Pointer to ble events handler..
82  *
83  * @retval ::SDK_SUCCESS: The profile info is recorded successfully, and the profile ENV will be initialized in profile initialization callback function.
84  * @retval ::SDK_ERR_POINTER_NULL: The parameter p_uuid or evt_handler is NULL, or input parameters that prf_info points to are invalid.
85  * @retval ::SDK_ERR_NO_RESOURCES: The profile number is up to the maximum number the system can support.
86  ****************************************************************************************
87  */
88 uint16_t ble_gattc_prf_add(ble_uuid_t *p_uuid, ble_evt_handler_t evt_handler);
89 /** @} */
90 
91 #endif
92 
93 /** @} */
94 /** @} */
ble_gatts_create_db_t
Parameter of Added service description.
Definition: ble_gatts.h:287
ble_gatts.h
BLE GATTS API.
ble_gatt.h
BLE GATT.
ble_gattc_prf_add
uint16_t ble_gattc_prf_add(ble_uuid_t *p_uuid, ble_evt_handler_t evt_handler)
Add a client profile by providing its detail information.
ble_error.h
File that contains error codes.
ble_gatts_prf_add
uint16_t ble_gatts_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.
ble_event.h
BLE event header files.
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:213
ble_gattc.h
BLE GATTC API.
ble_uuid_t
GATT UUID structure.
Definition: ble_gatt.h:81