Cordio Stack and Cordio Profiles  r2p3-02rel0
svc_gls.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief Example Glucose 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_GLS_H
21 #define SVC_GLS_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /*! \addtogroup GLUCOSE_SERVICE
28  * \{ */
29 
30 /**************************************************************************************************
31  Macros
32 **************************************************************************************************/
33 
34 /** \name Error Codes
35  *
36  */
37 /**@{*/
38 #define GLS_ERR_IN_PROGRESS 0x80 /*!< \brief Procedure already in progress */
39 #define GLS_ERR_CCCD 0x81 /*!< \brief CCCD improperly configured */
40 /**@}*/
41 
42 /**************************************************************************************************
43  Handle Ranges
44 **************************************************************************************************/
45 
46 /** \name Glucose Service Handles
47  *
48  */
49 /**@{*/
50 #define GLS_START_HDL 0xF0 /*!< \brief Start handle. */
51 #define GLS_END_HDL (GLS_MAX_HDL - 1) /*!< \brief End handle. */
52 
53 /**************************************************************************************************
54  Handles
55 **************************************************************************************************/
56 
57 /*! \brief Glucose Service Handles */
58 enum
59 {
60  GLS_SVC_HDL = GLS_START_HDL, /*!< \brief Glucose service declaration */
61  GLS_GLM_CH_HDL, /*!< \brief Glucose measurement characteristic */
62  GLS_GLM_HDL, /*!< \brief Glucose measurement */
63  GLS_GLM_CH_CCC_HDL, /*!< \brief Glucose measurement client characteristic configuration */
64  GLS_GLMC_CH_HDL, /*!< \brief Glucose measurement context characteristic */
65  GLS_GLMC_HDL, /*!< \brief Glucose measurement context */
66  GLS_GLMC_CH_CCC_HDL, /*!< \brief Glucose measurement context client characteristic configuration */
67  GLS_GLF_CH_HDL, /*!< \brief Glucose feature characteristic */
68  GLS_GLF_HDL, /*!< \brief Glucose feature */
69  GLS_RACP_CH_HDL, /*!< \brief Record access control point characteristic */
70  GLS_RACP_HDL, /*!< \brief Record access control point */
71  GLS_RACP_CH_CCC_HDL, /*!< \brief Record access control point client characteristic configuration */
72  GLS_MAX_HDL /*!< \brief Maximum handle. */
73 };
74 /**@}*/
75 
76 /**************************************************************************************************
77  Function Declarations
78 **************************************************************************************************/
79 
80 /*************************************************************************************************/
81 /*!
82  * \brief Add the services to the attribute server.
83  *
84  * \return None.
85  */
86 /*************************************************************************************************/
87 void SvcGlsAddGroup(void);
88 
89 /*************************************************************************************************/
90 /*!
91  * \brief Remove the services from the attribute server.
92  *
93  * \return None.
94  */
95 /*************************************************************************************************/
96 void SvcGlsRemoveGroup(void);
97 
98 /*************************************************************************************************/
99 /*!
100  * \brief Register callbacks for the service.
101  *
102  * \param readCback Read callback function.
103  * \param writeCback Write callback function.
104  *
105  * \return None.
106  */
107 /*************************************************************************************************/
108 void SvcGlsCbackRegister(attsReadCback_t readCback, attsWriteCback_t writeCback);
109 
110 /*! \} */ /* GLUCOSE_SERVICE */
111 
112 #ifdef __cplusplus
113 };
114 #endif
115 
116 #endif /* SVC_GLS_H */
Glucose measurement context client characteristic configuration.
Definition: svc_gls.h:66
Glucose feature.
Definition: svc_gls.h:68
Glucose measurement client characteristic configuration.
Definition: svc_gls.h:63
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
Glucose service declaration.
Definition: svc_gls.h:60
void SvcGlsCbackRegister(attsReadCback_t readCback, attsWriteCback_t writeCback)
Register callbacks for the service.
Record access control point client characteristic configuration.
Definition: svc_gls.h:71
void SvcGlsAddGroup(void)
Add the services to the attribute server.
Maximum handle.
Definition: svc_gls.h:72
Glucose measurement characteristic.
Definition: svc_gls.h:61
Glucose measurement.
Definition: svc_gls.h:62
Glucose measurement context.
Definition: svc_gls.h:65
Glucose feature characteristic.
Definition: svc_gls.h:67
Glucose measurement context characteristic.
Definition: svc_gls.h:64
#define GLS_START_HDL
Start handle.
Definition: svc_gls.h:50
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
Record access control point.
Definition: svc_gls.h:70
void SvcGlsRemoveGroup(void)
Remove the services from the attribute server.
Record access control point characteristic.
Definition: svc_gls.h:69