Cordio Stack and Cordio Profiles  r2p3-02rel0
svc_bps.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief Example Blood Pressure service implementation.
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 
20 #ifndef SVC_BPS_H
21 #define SVC_BPS_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /*! \addtogroup BLOOD_PRESSURE_SERVICE
28  * \{ */
29 
30 /**************************************************************************************************
31  Handle Ranges
32 **************************************************************************************************/
33 
34 /** \name Blood Pressure Service Handles
35  *
36  */
37 /**@{*/
38 #define BPS_START_HDL 0xE0 /*!< \brief Start handle. */
39 #define BPS_END_HDL (BPS_MAX_HDL - 1) /*!< \brief End handle. */
40 
41 /**************************************************************************************************
42  Handles
43 **************************************************************************************************/
44 
45 /*! \brief Blood Pressure Service Handles */
46 enum
47 {
48  BPS_SVC_HDL = BPS_START_HDL, /*!< \brief Blood pressure service declaration */
49  BPS_BPM_CH_HDL, /*!< \brief Blood pressure measurement characteristic */
50  BPS_BPM_HDL, /*!< \brief Blood pressure measurement */
51  BPS_BPM_CH_CCC_HDL, /*!< \brief Blood pressure measurement client characteristic configuration */
52  BPS_ICP_CH_HDL, /*!< \brief Intermediate cuff pressure characteristic */
53  BPS_ICP_HDL, /*!< \brief Intermediate cuff pressure */
54  BPS_ICP_CH_CCC_HDL, /*!< \brief Intermediate cuff pressure client characteristic configuration */
55  BPS_BPF_CH_HDL, /*!< \brief Blood pressure feature characteristic */
56  BPS_BPF_HDL, /*!< \brief Blood pressure feature */
57  BPS_MAX_HDL /*!< \brief Maximum handle. */
58 };
59 /**@}*/
60 
61 /**************************************************************************************************
62  Function Declarations
63 **************************************************************************************************/
64 
65 /*************************************************************************************************/
66 /*!
67  * \brief Add the services to the attribute server.
68  *
69  * \return None.
70  */
71 /*************************************************************************************************/
72 void SvcBpsAddGroup(void);
73 
74 /*************************************************************************************************/
75 /*!
76  * \brief Remove the services from the attribute server.
77  *
78  * \return None.
79  */
80 /*************************************************************************************************/
81 void SvcBpsRemoveGroup(void);
82 
83 /*************************************************************************************************/
84 /*!
85  * \brief Register callbacks for the service.
86  *
87  * \param readCback Read callback function.
88  * \param writeCback Write callback function.
89  *
90  * \return None.
91  */
92 /*************************************************************************************************/
93 void SvcBpsCbackRegister(attsReadCback_t readCback, attsWriteCback_t writeCback);
94 
95 /*************************************************************************************************/
96 /*!
97  * \brief Toggle flag values.
98  *
99  * \param flag Flag to manipulate.
100  *
101  * \return None.
102  */
103 /*************************************************************************************************/
105 
106 /*! \} */ /* BLOOD_PRESSURE_SERVICE */
107 
108 #ifdef __cplusplus
109 };
110 #endif
111 
112 #endif /* SVC_BPS_H */
void SvcBpsAddGroup(void)
Add the services to the attribute server.
Blood pressure feature.
Definition: svc_bps.h:56
Blood pressure measurement client characteristic configuration.
Definition: svc_bps.h:51
Blood pressure measurement.
Definition: svc_bps.h:50
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
Blood pressure measurement characteristic.
Definition: svc_bps.h:49
void SvcBpsCbackRegister(attsReadCback_t readCback, attsWriteCback_t writeCback)
Register callbacks for the service.
Intermediate cuff pressure client characteristic configuration.
Definition: svc_bps.h:54
Blood pressure service declaration.
Definition: svc_bps.h:48
#define BPS_START_HDL
Start handle.
Definition: svc_bps.h:38
void SvcBpsToggleFeatureFlags(uint8_t flag)
Toggle flag values.
Maximum handle.
Definition: svc_bps.h:57
Intermediate cuff pressure.
Definition: svc_bps.h:53
Blood pressure feature characteristic.
Definition: svc_bps.h:55
Intermediate cuff pressure characteristic.
Definition: svc_bps.h:52
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
unsigned char uint8_t
Unsigned 8-bit value.
Definition: wsf_types.h:63
void SvcBpsRemoveGroup(void)
Remove the services from the attribute server.