Cordio Stack and Cordio Profiles  r2p3-02rel0
plxps_api.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief Pulse Oximeter 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 PLXPS_API_H
20 #define PLXPS_API_H
21 
22 #include "app_hw.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 /*! \addtogroup PULSE_OXIMETER_PROFILE
29  * \{ */
30 
31 /**************************************************************************************************
32  Data Types
33 **************************************************************************************************/
34 
35 /*! \brief Configurable parameters */
36 typedef struct
37 {
38  wsfTimerTicks_t period; /*!< \brief Continuous Measurement timer expiration period in ms */
39 } plxpsCfg_t;
40 
41 /*! \brief Pulse Oximeter continuous measurement structure */
43 
44 /*! \brief Pulse Oximeter spot check measurement structure */
46 
47 /*************************************************************************************************/
48 /*!
49  * \brief Initialize the Pulse Oximeter profile sensor.
50  *
51  * \param handlerId DM connection identifier.
52  * \param pCfg Configuration parameters.
53  *
54  * \return None.
55  */
56 /*************************************************************************************************/
57 void PlxpsInit(wsfHandlerId_t handlerId, plxpsCfg_t *pCfg);
58 
59 /*************************************************************************************************/
60 /*!
61  * \brief This function is called by the application when a message that requires
62  * processing by the pulse oximeter profile sensor is received.
63  *
64  * \param pMsg Event message.
65  *
66  * \return None.
67  */
68 /*************************************************************************************************/
69 void PlxpsProcMsg(wsfMsgHdr_t *pMsg);
70 
71 /*************************************************************************************************/
72 /*!
73 * \brief Handle a button press.
74 *
75 * \param connId Connection identifier.
76 * \param btn Button press.
77 *
78 * \return None.
79 */
80 /*************************************************************************************************/
81 void PlxpsBtn(dmConnId_t connId, uint8_t btn);
82 
83 /*************************************************************************************************/
84 /*!
85  * \brief ATTS write callback for pulse oximeter service.
86  *
87  * \param connId DM connection identifier.
88  * \param handle ATT handle.
89  * \param operation ATT operation.
90  * \param offset Write offset.
91  * \param len Write length.
92  * \param pValue Value to write.
93  * \param pAttr Attribute to write.
94  *
95  * \return ATT status.
96  */
97 /*************************************************************************************************/
98 uint8_t PlxpsWriteCback(dmConnId_t connId, uint16_t handle, uint8_t operation,
99  uint16_t offset, uint16_t len, uint8_t *pValue, attsAttr_t *pAttr);
100 
101 /*************************************************************************************************/
102 /*!
103  * \brief Set the supported features of the pulse oximeter sensor.
104  *
105  * \param feature Feature bitmask.
106  * \param measStatus Measurement status.
107  * \param sensorStatus Sensor status.
108  *
109  * \return None.
110  */
111 /*************************************************************************************************/
112 void PlxpsSetFeature(uint16_t feature, uint16_t measStatus, uint32_t sensorStatus);
113 
114 /*************************************************************************************************/
115 /*!
116  * \brief Set the CCCD index used by the application for pulse oximeter service characteristics.
117  *
118  * \param plxscCccIdx Pulse Oximeter spot check CCCD index.
119  * \param plxcCccIdx Pulse Oximeter continuous CCCD index.
120  * \param racpCccIdx Record access control point CCCD index.
121  *
122  * \return None.
123  */
124 /*************************************************************************************************/
125 void PlxpsSetCccIdx(uint8_t plxscCccIdx, uint8_t plxcCccIdx, uint8_t racpCccIdx);
126 
127 /*************************************************************************************************/
128 /*!
129  * \brief Start periodic pulse oximeter measurement. This function starts a timer to perform
130  * periodic measurements.
131  *
132  * \param connId DM connection identifier.
133  * \param timerEvt WSF event designated by the application for the timer.
134  * \param plxmCccIdx Index of pulse oximeter CCC descriptor in CCC descriptor handle table.
135  *
136  * \return None.
137  */
138 /*************************************************************************************************/
139 void PlxpsMeasStart(dmConnId_t connId, uint8_t timerEvt, uint8_t plxmCccIdx);
140 
141 /*************************************************************************************************/
142 /*!
143  * \brief Stop periodic pulse oximeter measurement.
144  *
145  * \return None.
146  */
147 /*************************************************************************************************/
148 void PlxpsMeasStop(void);
149 
150 /*************************************************************************************************/
151 /*!
152  * \brief Send a spot check measurement indication.
153  *
154  * \param connId Connection ID.
155  * \param pMeas Pointer to pulse oximeter spot check measurement.
156  *
157  * \return None.
158  */
159 /*************************************************************************************************/
160 void plxpsSendSpotCheckMeas(dmConnId_t connId, plxpScm_t *pMeas);
161 
162 /*************************************************************************************************/
163 /*!
164  * \brief Send a Continuous measurement notification.
165  *
166  * \param connId Connection ID.
167  * \param pMeas Pointer to Pulse Oximiter continuous measurement.
168  *
169  * \return None.
170  */
171 /*************************************************************************************************/
172 void plxpsSendContinuousMeas(dmConnId_t connId, plxpCm_t *pMeas);
173 
174 /*! \} */ /* PULSE_OXIMETER_PROFILE */
175 
176 #ifdef __cplusplus
177 };
178 #endif
179 
180 #endif /* PLXPS_API_H */
void plxpsSendSpotCheckMeas(dmConnId_t connId, plxpScm_t *pMeas)
Send a spot check measurement indication.
void PlxpsInit(wsfHandlerId_t handlerId, plxpsCfg_t *pCfg)
Initialize the Pulse Oximeter profile sensor.
appPlxScm_t plxpScm_t
Pulse Oximeter spot check measurement structure.
Definition: plxps_api.h:45
uint8_t dmConnId_t
Connection identifier.
Definition: dm_api.h:501
wsfTimerTicks_t period
Continuous Measurement timer expiration period in ms.
Definition: plxps_api.h:38
void PlxpsProcMsg(wsfMsgHdr_t *pMsg)
This function is called by the application when a message that requires processing by the pulse oxime...
appPlxCm_t plxpCm_t
Pulse Oximeter continuous measurement structure.
Definition: plxps_api.h:42
Application framework hardware interfaces.
Pulse Oximeter continuous measurement structure.
Definition: app_hw.h:85
uint8_t PlxpsWriteCback(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 pulse oximeter service.
unsigned long uint32_t
Unsigned 32-bit value.
Definition: wsf_types.h:71
uint8_t wsfHandlerId_t
Event handler ID data type.
Definition: wsf_os.h:74
Configurable parameters.
Definition: plxps_api.h:36
void PlxpsBtn(dmConnId_t connId, uint8_t btn)
Handle a button press.
Attribute structure.
Definition: att_api.h:186
void plxpsSendContinuousMeas(dmConnId_t connId, plxpCm_t *pMeas)
Send a Continuous measurement notification.
unsigned short uint16_t
Unsigned 16-bit value.
Definition: wsf_types.h:67
void PlxpsMeasStart(dmConnId_t connId, uint8_t timerEvt, uint8_t plxmCccIdx)
Start periodic pulse oximeter measurement. This function starts a timer to perform periodic measureme...
uint32_t wsfTimerTicks_t
Timer ticks data type.
Definition: wsf_timer.h:45
void PlxpsSetCccIdx(uint8_t plxscCccIdx, uint8_t plxcCccIdx, uint8_t racpCccIdx)
Set the CCCD index used by the application for pulse oximeter service characteristics.
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
Pulse Oximeter spot check measurement structure.
Definition: app_hw.h:100
void PlxpsSetFeature(uint16_t feature, uint16_t measStatus, uint32_t sensorStatus)
Set the supported features of the pulse oximeter sensor.
void PlxpsMeasStop(void)
Stop periodic pulse oximeter measurement.