Cordio Stack and Cordio Profiles  r2p3-02rel0
glps_api.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief Glucose profile sensor.
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 GLPS_API_H
20 #define GLPS_API_H
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 /*! \addtogroup GLUCOSE_PROFILE
27  * \{ */
28 
29 /**************************************************************************************************
30  Macros
31 **************************************************************************************************/
32 
33 /*! \brief All supported features of the glucose profile */
34 #define GLP_ALL_SUPPORTED_FEATURES 0x000F
35 
36 /*************************************************************************************************/
37 /*!
38  * \brief Initialize the Glucose profile sensor.
39  *
40  * \return None.
41  */
42 /*************************************************************************************************/
43 void GlpsInit(void);
44 
45 /*************************************************************************************************/
46 /*!
47  * \brief This function is called by the application when a message that requires
48  * processing by the glucose profile sensor is received.
49  *
50  * \param pMsg Event message.
51  *
52  * \return None.
53  */
54 /*************************************************************************************************/
55 void GlpsProcMsg(wsfMsgHdr_t *pMsg);
56 
57 /*************************************************************************************************/
58 /*!
59 * \brief Handle a button press.
60 *
61 * \param connId Connection identifier.
62 * \param btn Button press.
63 *
64 * \return None.
65 */
66 /*************************************************************************************************/
67 void GlpsBtn(dmConnId_t connId, uint8_t btn);
68 
69 /*************************************************************************************************/
70 /*!
71  * \brief ATTS write callback for glucose service record access control point. Use this
72  * function as a parameter to SvcGlsCbackRegister().
73  *
74  * \param connId DM connection identifier.
75  * \param handle ATT handle.
76  * \param operation ATT operation.
77  * \param offset Write offset.
78  * \param len Write length.
79  * \param pValue Value to write.
80  * \param pAttr Attribute to write.
81  *
82  * \return ATT status.
83  */
84 /*************************************************************************************************/
85 uint8_t GlpsRacpWriteCback(dmConnId_t connId, uint16_t handle, uint8_t operation,
86  uint16_t offset, uint16_t len, uint8_t *pValue, attsAttr_t *pAttr);
87 
88 /*************************************************************************************************/
89 /*!
90  * \brief Set the supported features of the glucose sensor.
91  *
92  * \param feature Feature bitmask.
93  *
94  * \return None.
95  */
96 /*************************************************************************************************/
97 void GlpsSetFeature(uint16_t feature);
98 
99 /*************************************************************************************************/
100 /*!
101  * \brief Set the CCCD index used by the application for glucose service characteristics.
102  *
103  * \param glmCccIdx Glucose measurement CCCD index.
104  * \param glmcCccIdx Glucose measurement context CCCD index.
105  * \param racpCccIdx Record access control point CCCD index.
106  *
107  * \return None.
108  */
109 /*************************************************************************************************/
110 void GlpsSetCccIdx(uint8_t glmCccIdx, uint8_t glmcCccIdx, uint8_t racpCccIdx);
111 
112 /*! \} */ /* GLUCOSE_PROFILE */
113 
114 #ifdef __cplusplus
115 };
116 #endif
117 
118 #endif /* GLPS_API_H */
void GlpsSetFeature(uint16_t feature)
Set the supported features of the glucose sensor.
void GlpsProcMsg(wsfMsgHdr_t *pMsg)
This function is called by the application when a message that requires processing by the glucose pro...
uint8_t dmConnId_t
Connection identifier.
Definition: dm_api.h:501
void GlpsBtn(dmConnId_t connId, uint8_t btn)
Handle a button press.
void GlpsInit(void)
Initialize the Glucose profile sensor.
Attribute structure.
Definition: att_api.h:186
unsigned short uint16_t
Unsigned 16-bit value.
Definition: wsf_types.h:67
uint8_t GlpsRacpWriteCback(dmConnId_t connId, uint16_t handle, uint8_t operation, uint16_t offset, uint16_t len, uint8_t *pValue, attsAttr_t *pAttr)
ATTS write callback for glucose service record access control point. Use this function as a parameter...
Common message structure passed to event handler.
Definition: wsf_os.h:97
unsigned char uint8_t
Unsigned 8-bit value.
Definition: wsf_types.h:63
void GlpsSetCccIdx(uint8_t glmCccIdx, uint8_t glmcCccIdx, uint8_t racpCccIdx)
Set the CCCD index used by the application for glucose service characteristics.