Cordio Stack and Cordio Profiles  r2p3-02rel0
hrps_api.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief Heart Rate profile sensor.
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 #ifndef HRPS_API_H
20 #define HRPS_API_H
21 
22 #include "wsf_timer.h"
23 #include "att_api.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 /*! \addtogroup HEART_RATE_PROFILE
30  * \{ */
31 
32 /**************************************************************************************************
33  Data Types
34 **************************************************************************************************/
35 
36 /*! \brief Configurable parameters */
37 typedef struct
38 {
39  wsfTimerTicks_t period; /*!< \brief Measurement timer expiration period in ms */
40 } hrpsCfg_t;
41 
42 /*************************************************************************************************/
43 /*!
44  * \brief Initialize the Heart Rate profile sensor.
45  *
46  * \param handlerId WSF handler ID of the application using this service.
47  * \param pCfg Configurable parameters.
48  *
49  * \return None.
50  */
51 /*************************************************************************************************/
52 void HrpsInit(wsfHandlerId_t handlerId, hrpsCfg_t *pCfg);
53 
54 /*************************************************************************************************/
55 /*!
56  * \brief Start periodic heart rate measurement. This function starts a timer to perform
57  * periodic measurements.
58  *
59  * \param connId DM connection identifier.
60  * \param timerEvt WSF event designated by the application for the timer.
61  * \param hrmCccIdx Index of heart rate CCC descriptor in CCC descriptor handle table.
62  *
63  * \return None.
64  */
65 /*************************************************************************************************/
66 void HrpsMeasStart(dmConnId_t connId, uint8_t timerEvt, uint8_t hrmCccIdx);
67 
68 /*************************************************************************************************/
69 /*!
70  * \brief Stop periodic heart rate measurement.
71  *
72  * \param connId DM connection identifier.
73  *
74  * \return None.
75  */
76 /*************************************************************************************************/
77 void HrpsMeasStop(dmConnId_t connId);
78 
79 /*************************************************************************************************/
80 /*!
81  * \brief Process received WSF message.
82  *
83  * \param pMsg Event message.
84  *
85  * \return None.
86  */
87 /*************************************************************************************************/
88 void HrpsProcMsg(wsfMsgHdr_t *pMsg);
89 
90 /*************************************************************************************************/
91 /*!
92  * \brief ATTS write callback for heart rate service Use this function as a parameter
93  * to SvcHrsCbackRegister().
94  *
95  * \param connId DM connection identifier.
96  * \param handle ATT handle.
97  * \param operation ATT operation.
98  * \param offset Write offset.
99  * \param len Write length.
100  * \param pValue Value to write.
101  * \param pAttr Attribute to write.
102  *
103  * \return ATT status.
104  */
105 /*************************************************************************************************/
106 uint8_t HrpsWriteCback(dmConnId_t connId, uint16_t handle, uint8_t operation,
107  uint16_t offset, uint16_t len, uint8_t *pValue, attsAttr_t *pAttr);
108 
109 /*************************************************************************************************/
110 /*!
111  * \brief Set the heart rate measurement flags.
112  *
113  * \param flags Heart rate measurement flags.
114  *
115  * \return None.
116  */
117 /*************************************************************************************************/
118 void HrpsSetFlags(uint8_t flags);
119 
120 /*! \} */ /* HEART_RATE_PROFILE */
121 
122 #ifdef __cplusplus
123 };
124 #endif
125 
126 #endif /* HRPS_API_H */
uint8_t dmConnId_t
Connection identifier.
Definition: dm_api.h:501
void HrpsMeasStop(dmConnId_t connId)
Stop periodic heart rate measurement.
void HrpsInit(wsfHandlerId_t handlerId, hrpsCfg_t *pCfg)
Initialize the Heart Rate profile sensor.
void HrpsMeasStart(dmConnId_t connId, uint8_t timerEvt, uint8_t hrmCccIdx)
Start periodic heart rate measurement. This function starts a timer to perform periodic measurements...
uint8_t HrpsWriteCback(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 heart rate service Use this function as a parameter to SvcHrsCbackRegister()...
void HrpsSetFlags(uint8_t flags)
Set the heart rate measurement flags.
wsfTimerTicks_t period
Measurement timer expiration period in ms.
Definition: hrps_api.h:39
uint8_t wsfHandlerId_t
Event handler ID data type.
Definition: wsf_os.h:74
Attribute structure.
Definition: att_api.h:186
Configurable parameters.
Definition: hrps_api.h:37
unsigned short uint16_t
Unsigned 16-bit value.
Definition: wsf_types.h:67
Timer service.
uint32_t wsfTimerTicks_t
Timer ticks data type.
Definition: wsf_timer.h:45
Attribute protocol client and server API.
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 HrpsProcMsg(wsfMsgHdr_t *pMsg)
Process received WSF message.