Cordio Stack and Cordio Profiles  r2p3-02rel0
svc_hrs.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief Example Heart Rate service implementation.
6  *
7  * Copyright (c) 2011-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 
20 #ifndef SVC_HRS_H
21 #define SVC_HRS_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /*! \addtogroup HEART_RATE_SERVICE
28  * \{ */
29 
30 /**************************************************************************************************
31  Macros
32 **************************************************************************************************/
33 
34 /** \name Heart Rate Error Codes
35  *
36  */
37 /**@{*/
38 #define HRS_ERR_CP_NOT_SUP 0x80 /*!< \brief Control Point value not supported */
39 /**@}*/
40 
41 /**************************************************************************************************
42  Handle Ranges
43 **************************************************************************************************/
44 
45 /** \name Heart Rate Service Handles
46  *
47  */
48 /**@{*/
49 #define HRS_START_HDL 0x20 /*!< \brief Start handle. */
50 #define HRS_END_HDL (HRS_MAX_HDL - 1) /*!< \brief End handle. */
51 
52 /**************************************************************************************************
53  Handles
54 **************************************************************************************************/
55 
56 /*! \brief Heart Rate Service Handles */
57 enum
58 {
59  HRS_SVC_HDL = HRS_START_HDL, /*!< \brief Heart rate service declaration */
60  HRS_HRM_CH_HDL, /*!< \brief Heart rate measurement characteristic */
61  HRS_HRM_HDL, /*!< \brief Heart rate measurement */
62  HRS_HRM_CH_CCC_HDL, /*!< \brief Heart rate measurement client characteristic configuration */
63  HRS_SL_CH_HDL, /*!< \brief Body sensor location characteristic */
64  HRS_SL_HDL, /*!< \brief Body sensor location */
65  HRS_CP_CH_HDL, /*!< \brief Heart rate control point characteristic */
66  HRS_CP_HDL, /*!< \brief Heart rate control point */
67  HRS_MAX_HDL /*!< \brief Maximum handle. */
68 };
69 /**@}*/
70 
71 /**************************************************************************************************
72  Function Declarations
73 **************************************************************************************************/
74 
75 /*************************************************************************************************/
76 /*!
77  * \brief Add the services to the attribute server.
78  *
79  * \return None.
80  */
81 /*************************************************************************************************/
82 void SvcHrsAddGroup(void);
83 
84 /*************************************************************************************************/
85 /*!
86  * \brief Remove the services from the attribute server.
87  *
88  * \return None.
89  */
90 /*************************************************************************************************/
91 void SvcHrsRemoveGroup(void);
92 
93 /*************************************************************************************************/
94 /*!
95  * \brief Register callbacks for the service.
96  *
97  * \param readCback Read callback function.
98  * \param writeCback Write callback function.
99  *
100  * \return None.
101  */
102 /*************************************************************************************************/
103 void SvcHrsCbackRegister(attsReadCback_t readCback, attsWriteCback_t writeCback);
104 
105 /*! \} */ /* HEART_RATE_SERVICE */
106 
107 #ifdef __cplusplus
108 };
109 #endif
110 
111 #endif /* SVC_HRS_H */
Body sensor location characteristic.
Definition: svc_hrs.h:63
void SvcHrsCbackRegister(attsReadCback_t readCback, attsWriteCback_t writeCback)
Register callbacks for the service.
Maximum handle.
Definition: svc_hrs.h:67
uint8_t(* attsWriteCback_t)(dmConnId_t connId, uint16_t handle, uint8_t operation, uint16_t offset, uint16_t len, uint8_t *pValue, attsAttr_t *pAttr)
Attribute group write callback.
Definition: att_api.h:237
Heart rate control point characteristic.
Definition: svc_hrs.h:65
void SvcHrsAddGroup(void)
Add the services to the attribute server.
Heart rate measurement.
Definition: svc_hrs.h:61
Heart rate control point.
Definition: svc_hrs.h:66
Body sensor location.
Definition: svc_hrs.h:64
void SvcHrsRemoveGroup(void)
Remove the services from the attribute server.
Heart rate measurement client characteristic configuration.
Definition: svc_hrs.h:62
Heart rate measurement characteristic.
Definition: svc_hrs.h:60
uint8_t(* attsReadCback_t)(dmConnId_t connId, uint16_t handle, uint8_t operation, uint16_t offset, attsAttr_t *pAttr)
Attribute group read callback.
Definition: att_api.h:218
Heart rate service declaration.
Definition: svc_hrs.h:59
#define HRS_START_HDL
Start handle.
Definition: svc_hrs.h:49