Cordio Stack and Cordio Profiles  r2p3-02rel0
gap_api.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief GAP profile.
6  *
7  * Copyright (c) 2015-2018 Arm Ltd. All Rights Reserved.
8  * Arm Ltd. confidential and proprietary.
9  *
10  * IMPORTANT. Your use of this file is governed by a Software License Agreement
11  * ("Agreement") that must be accepted in order to download or otherwise receive a
12  * copy of this file. You may not use or copy this file for any purpose other than
13  * as described in the Agreement. If you do not agree to all of the terms of the
14  * Agreement do not use this file and delete all copies in your possession or control;
15  * if you do not have a copy of the Agreement, you must contact Arm Ltd. prior
16  * to any use, copying or further distribution of this software.
17  */
18 /*************************************************************************************************/
19 #ifndef GAP_API_H
20 #define GAP_API_H
21 
22 #include "att_api.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 /*! \addtogroup GAP_PROFILE
29  * \{ */
30 
31 /**************************************************************************************************
32  Macros
33 **************************************************************************************************/
34 
35 /*! \brief Enumeration of handle indexes of characteristics to be discovered */
36 enum
37 {
38  GAP_CAR_HDL_IDX, /*!< \brief Central Address Resolution */
39  GAP_RPAO_HDL_IDX, /*!< \brief Resolvable Private Address Only */
40  GAP_HDL_LIST_LEN /*!< \brief Handle list length */
41 };
42 
43 /**************************************************************************************************
44  Function Declarations
45 **************************************************************************************************/
46 
47 /*************************************************************************************************/
48 /*!
49  * \brief Perform service and characteristic discovery for GAP service. Note that pHdlList
50  * must point to an array of handles of length \ref GAP_HDL_LIST_LEN. If discovery is
51  * successful the handles of discovered characteristics and descriptors will be set
52  * in pHdlList.
53  *
54  * \param connId Connection identifier.
55  * \param pHdlList Characteristic handle list.
56  *
57  * \return None.
58  */
59 /*************************************************************************************************/
60 void GapDiscover(dmConnId_t connId, uint16_t *pHdlList);
61 
62 /*************************************************************************************************/
63 /*!
64  * \brief Process a value received in an ATT read response, notification, or indication
65  * message. Parameter pHdlList must point to an array of length \ref GAP_HDL_LIST_LEN.
66  * If the attribute handle of the message matches a handle in the handle list the value
67  * is processed, otherwise it is ignored.
68  *
69  * \param pHdlList Characteristic handle list.
70  * \param pMsg ATT callback message.
71  *
72  * \return \ref ATT_SUCCESS if handle is found, \ref ATT_ERR_NOT_FOUND otherwise.
73  */
74 /*************************************************************************************************/
75 uint8_t GapValueUpdate(uint16_t *pHdlList, attEvt_t *pMsg);
76 
77 /*! \} */ /* GAP_PROFILE */
78 
79 #ifdef __cplusplus
80 };
81 #endif
82 
83 #endif /* GAP_API_H */
Resolvable Private Address Only.
Definition: gap_api.h:39
uint8_t dmConnId_t
Connection identifier.
Definition: dm_api.h:501
ATT callback event.
Definition: att_api.h:154
Handle list length.
Definition: gap_api.h:40
unsigned short uint16_t
Unsigned 16-bit value.
Definition: wsf_types.h:67
void GapDiscover(dmConnId_t connId, uint16_t *pHdlList)
Perform service and characteristic discovery for GAP service. Note that pHdlList must point to an arr...
Central Address Resolution.
Definition: gap_api.h:38
Attribute protocol client and server API.
unsigned char uint8_t
Unsigned 8-bit value.
Definition: wsf_types.h:63
uint8_t GapValueUpdate(uint16_t *pHdlList, attEvt_t *pMsg)
Process a value received in an ATT read response, notification, or indication message. Parameter pHdlList must point to an array of length GAP_HDL_LIST_LEN. If the attribute handle of the message matches a handle in the handle list the value is processed, otherwise it is ignored.