Cordio Stack and Cordio Profiles  r2p3-02rel0
hrpc_api.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief Heart Rate profile client.
6  *
7  * Copyright (c) 2012-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 HRPC_API_H
20 #define HRPC_API_H
21 
22 #include "att_api.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 /*! \addtogroup HEART_RATE_PROFILE
29  * \{ */
30 
31 /**************************************************************************************************
32  Macros
33 **************************************************************************************************/
34 
35 /*! \brief Heart Rate service enumeration of handle indexes of characteristics to be discovered */
36 enum
37 {
38  HRPC_HRS_HRM_HDL_IDX, /*!< \brief Heart rate measurement */
39  HRPC_HRS_HRM_CCC_HDL_IDX, /*!< \brief Heart rate measurement CCC descriptor */
40  HRPC_HRS_BSL_HDL_IDX, /*!< \brief Body sensor location */
41  HRPC_HRS_HRCP_HDL_IDX, /*!< \brief Heart rate control point */
42  HRPC_HRS_HDL_LIST_LEN /*!< \brief Handle list length */
43 };
44 
45 /**************************************************************************************************
46  Function Declarations
47 **************************************************************************************************/
48 
49 /*************************************************************************************************/
50 /*!
51  * \brief Perform service and characteristic discovery for Heart Rate service.
52  * Parameter pHdlList must point to an array of length \ref HRPC_HRS_HDL_LIST_LEN.
53  * If discovery is successful the handles of discovered characteristics and
54  * descriptors will be set in pHdlList.
55  *
56  * \param connId Connection identifier.
57  * \param pHdlList Characteristic handle list.
58  *
59  * \return None.
60  */
61 /*************************************************************************************************/
62 void HrpcHrsDiscover(dmConnId_t connId, uint16_t *pHdlList);
63 
64 /*************************************************************************************************/
65 /*!
66  * \brief Send a command to the heart rate control point.
67  *
68  * \param connId Connection identifier.
69  * \param handle Attribute handle.
70  * \param command Control point command.
71  *
72  * \return None.
73  */
74 /*************************************************************************************************/
75 void HrpcHrsControl(dmConnId_t connId, uint16_t handle, uint8_t command);
76 
77 /*************************************************************************************************/
78 /*!
79  * \brief Process a value received in an ATT read response, notification, or indication
80  * message. Parameter pHdlList must point to an array of length \ref HRPC_HRS_HDL_LIST_LEN.
81  * If the ATT handle of the message matches a handle in the handle list the value
82  * is processed, otherwise it is ignored.
83  *
84  * \param pHdlList Characterist handle list.
85  * \param pMsg ATT callback message.
86  *
87  * \return \ref ATT_SUCCESS if handle is found, \ref ATT_ERR_NOT_FOUND otherwise.
88  */
89 /*************************************************************************************************/
91 
92 /*! \} */ /* HEART_RATE_PROFILE */
93 
94 #ifdef __cplusplus
95 };
96 #endif
97 
98 #endif /* HRPC_API_H */
Handle list length.
Definition: hrpc_api.h:42
uint8_t dmConnId_t
Connection identifier.
Definition: dm_api.h:501
ATT callback event.
Definition: att_api.h:154
void HrpcHrsControl(dmConnId_t connId, uint16_t handle, uint8_t command)
Send a command to the heart rate control point.
uint8_t HrpcHrsValueUpdate(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 HRPC_HRS_HDL_LIST_LEN. If the ATT handle of the message matches a handle in the handle list the value is processed, otherwise it is ignored.
Body sensor location.
Definition: hrpc_api.h:40
Heart rate control point.
Definition: hrpc_api.h:41
Heart rate measurement.
Definition: hrpc_api.h:38
unsigned short uint16_t
Unsigned 16-bit value.
Definition: wsf_types.h:67
Attribute protocol client and server API.
unsigned char uint8_t
Unsigned 8-bit value.
Definition: wsf_types.h:63
Heart rate measurement CCC descriptor.
Definition: hrpc_api.h:39
void HrpcHrsDiscover(dmConnId_t connId, uint16_t *pHdlList)
Perform service and characteristic discovery for Heart Rate service. Parameter pHdlList must point to...