Cordio Stack and Cordio Profiles  r2p3-02rel0
glpc_api.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief Glucose profile collector.
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 GLPC_API_H
20 #define GLPC_API_H
21 
22 #include "att_api.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 /*! \addtogroup GLUCOSE_PROFILE
29  * \{ */
30 
31 /**************************************************************************************************
32  Macros
33 **************************************************************************************************/
34 
35 /*! \brief Glucose service enumeration of handle indexes of characteristics to be discovered */
36 enum
37 {
38  GLPC_GLS_GLM_HDL_IDX, /*!< \brief Glucose measurement */
39  GLPC_GLS_GLM_CCC_HDL_IDX, /*!< \brief Glucose measurement CCC descriptor */
40  GLPC_GLS_GLMC_HDL_IDX, /*!< \brief Glucose measurement context */
41  GLPC_GLS_GLMC_CCC_HDL_IDX, /*!< \brief Glucose measurement context CCC descriptor */
42  GLPC_GLS_GLF_HDL_IDX, /*!< \brief Glucose feature */
43  GLPC_GLS_RACP_HDL_IDX, /*!< \brief Record access control point */
44  GLPC_GLS_RACP_CCC_HDL_IDX, /*!< \brief Record access control point CCC descriptor */
45  GLPC_GLS_HDL_LIST_LEN /*!< \brief Handle list length */
46 };
47 
48 /**************************************************************************************************
49  Data Types
50 **************************************************************************************************/
51 
52 /*! \brief Glucose service RACP filter type */
53 typedef struct
54 {
55  union
56  {
57  uint16_t seqNum; /*!< \brief Sequence number filter */
58  } param; /*!< \brief Parameter union */
59  uint8_t type; /*!< \brief Filter type */
60 } glpcFilter_t;
61 
62 /**************************************************************************************************
63  Function Declarations
64 **************************************************************************************************/
65 
66 /*************************************************************************************************/
67 /*!
68  * \brief Perform service and characteristic discovery for Glucose service.
69  * Parameter pHdlList must point to an array of length \ref GLPC_GLS_HDL_LIST_LEN.
70  * If discovery is successful the handles of discovered characteristics and
71  * descriptors will be set in pHdlList.
72  *
73  * \param connId Connection identifier.
74  * \param pHdlList Characteristic handle list.
75  *
76  * \return None.
77  */
78 /*************************************************************************************************/
79 void GlpcGlsDiscover(dmConnId_t connId, uint16_t *pHdlList);
80 
81 /*************************************************************************************************/
82 /*!
83  * \brief Process a value received in an ATT read response, notification, or indication
84  * message. Parameter pHdlList must point to an array of length \ref GLPC_GLS_HDL_LIST_LEN.
85  * If the ATT handle of the message matches a handle in the handle list the value
86  * is processed, otherwise it is ignored.
87  *
88  * \param pHdlList Characteristic handle list.
89  * \param pMsg ATT callback message.
90  *
91  * \return \ref ATT_SUCCESS if handle is found, \ref ATT_ERR_NOT_FOUND otherwise.
92  */
93 /*************************************************************************************************/
95 
96 /*************************************************************************************************/
97 /*!
98  * \brief Send a command to the glucose service record access control point.
99  *
100  * \param connId Connection identifier.
101  * \param handle Attribute handle.
102  * \param opcode Command opcode.
103  * \param oper Command operator or 0 if no operator required.
104  * \param pFilter Command filter parameters or NULL of no parameters required.
105  *
106  * \return None.
107  */
108 /*************************************************************************************************/
109 void GlpcGlsRacpSend(dmConnId_t connId, uint16_t handle, uint8_t opcode, uint8_t oper,
110  glpcFilter_t *pFilter);
111 
112 /*************************************************************************************************/
113 /*!
114  * \brief Set the last received glucose measurement sequence number.
115  *
116  * \param seqNum Glucose measurement sequence number.
117  *
118  * \return None.
119  */
120 /*************************************************************************************************/
121 void GlpcGlsSetLastSeqNum(uint16_t seqNum);
122 
123 /*************************************************************************************************/
124 /*!
125  * \brief Get the last received glucose measurement sequence number.
126  *
127  * \return Last received glucose measurement sequence number.
128  */
129 /*************************************************************************************************/
131 
132 /*! \} */ /* GLUCOSE_PROFILE */
133 
134 #ifdef __cplusplus
135 };
136 #endif
137 
138 #endif /* GLPC_API_H */
Glucose service RACP filter type.
Definition: glpc_api.h:53
Handle list length.
Definition: glpc_api.h:45
uint8_t dmConnId_t
Connection identifier.
Definition: dm_api.h:501
ATT callback event.
Definition: att_api.h:154
void GlpcGlsSetLastSeqNum(uint16_t seqNum)
Set the last received glucose measurement sequence number.
uint16_t seqNum
Sequence number filter.
Definition: glpc_api.h:57
Glucose measurement context.
Definition: glpc_api.h:40
uint8_t GlpcGlsValueUpdate(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 GLPC_GLS_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.
void GlpcGlsDiscover(dmConnId_t connId, uint16_t *pHdlList)
Perform service and characteristic discovery for Glucose service. Parameter pHdlList must point to an...
Record access control point.
Definition: glpc_api.h:43
Glucose measurement context CCC descriptor.
Definition: glpc_api.h:41
Record access control point CCC descriptor.
Definition: glpc_api.h:44
uint16_t GlpcGlsGetLastSeqNum(void)
Get the last received glucose measurement sequence number.
Glucose measurement CCC descriptor.
Definition: glpc_api.h:39
unsigned short uint16_t
Unsigned 16-bit value.
Definition: wsf_types.h:67
Glucose measurement.
Definition: glpc_api.h:38
Glucose feature.
Definition: glpc_api.h:42
void GlpcGlsRacpSend(dmConnId_t connId, uint16_t handle, uint8_t opcode, uint8_t oper, glpcFilter_t *pFilter)
Send a command to the glucose service record access control point.
Attribute protocol client and server API.
unsigned char uint8_t
Unsigned 8-bit value.
Definition: wsf_types.h:63
uint8_t type
Filter type.
Definition: glpc_api.h:59