Cordio Stack and Cordio Profiles  r2p3-02rel0
cpp_api.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3 * \file
4 *
5 * \brief Cycling Power Profile API.
6 *
7 * Copyright (c) 2016-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 CPP_API_H
21 #define CPP_API_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /*! \addtogroup CYCLING_POWER_PROFILE
28  * \{ */
29 
30 /**************************************************************************************************
31 Macros
32 **************************************************************************************************/
33 
34 /** \name Cycle Power Measurement Types
35  *
36  */
37 /**@{*/
38 #define CPP_PM_PARAM_INSTANTANEOUS_POWER 0 /* Instantaneous Power Measurement */
39 #define CPP_PM_PARAM_PEDAL_POWER 1 /* Pedal Power Balance */
40 #define CPP_PM_PARAM_ACCUMULATED_TORQUE 2 /* Accumulated Torque */
41 #define CPP_PM_PARAM_WHEEL_REVOLUTIONS 3 /* Wheel Revolution */
42 #define CPP_PM_PARAM_LAST_WHEEL_REV_TIME 4 /* Last Wheel Revolution Event Time */
43 #define CPP_PM_PARAM_CRANK_REVOLUTIONS 5 /* Crank Revolution */
44 #define CPP_PM_PARAM_LAST_CRANK_TIME 6 /* Last Crank Revolution Event Time */
45 #define CPP_PM_PARAM_MAX_FORCE_MAGNITUDE 7 /* Max Extreme Force Magnitudes */
46 #define CPP_PM_PARAM_MIN_FORCE_MAGNITUDE 8 /* Min Extreme Force Magnitudes */
47 #define CPP_PM_PARAM_MAX_TORQUE_MAGNITUDE 9 /* Max Extreme Torque Magnitudes */
48 #define CPP_PM_PARAM_MIN_TORQUE_MAGNITUDE 10 /* Min Extreme Torque Magnitudes */
49 #define CPP_PM_PARAM_MAX_EXTREME_ANGLE 11 /* Max Extreme Angles */
50 #define CPP_PM_PARAM_MIN_EXTREME_ANGLE 12 /* Min Extreme Angles */
51 #define CPP_PM_PARAM_TOP_DEAD_SPOT 13 /* Top Dead Spot Angle */
52 #define CPP_PM_PARAM_BOTTOM_DEAD_SPOT 14 /* Bottom Dead Spot Angle */
53 #define CPP_PM_PARAM_ACCUMULATED_ENERGY 15 /* Accumulated Energy */
54 /**@}*/
55 
56 /**************************************************************************************************
57 Function Declarations
58 **************************************************************************************************/
59 
60 /*************************************************************************************************/
61 /*!
62  * \brief Setup connection specific variables.
63  *
64  * \param connId Connection ID
65  *
66  * \return none
67  */
68 /*************************************************************************************************/
69 void CppsConnOpen(dmConnId_t connId);
70 
71 /*************************************************************************************************/
72 /*!
73 * \brief Notifies the collector of a Cycle Power Measurement.
74 *
75 * \param connId Connection ID
76 *
77 * \return none
78 */
79 /*************************************************************************************************/
81 
82 /*************************************************************************************************/
83 /*!
84 * \brief Set a cycle measurement parameter.
85 *
86 * \param type Parameter identifier
87 * \param value Measurement value.
88 *
89 * \return none
90 */
91 /*************************************************************************************************/
92 void CppsSetParameter(uint8_t type, uint32_t value);
93 
94 /*************************************************************************************************/
95 /*!
96 * \brief Set the sensor location attribute.
97 *
98 * \param location Sensor Location.
99 *
100 * \return none
101 */
102 /*************************************************************************************************/
103 void CppsSetSensorLocation(uint8_t location);
104 
105 /*************************************************************************************************/
106 /*!
107 * \brief Set the features attribute.
108 *
109 * \param features Features bitmask.
110 *
111 * \return none
112 */
113 /*************************************************************************************************/
114 void CppsSetFeatures(uint32_t features);
115 
116 /*! \} */ /* CYCLING_POWER_PROFILE */
117 
118 #ifdef __cplusplus
119 };
120 #endif
121 
122 #endif /* CPP_API_H */
uint8_t dmConnId_t
Connection identifier.
Definition: dm_api.h:501
void CppsSetFeatures(uint32_t features)
Set the features attribute.
void CppsSendPowerMeasurement(dmConnId_t connId)
Notifies the collector of a Cycle Power Measurement.
void CppsConnOpen(dmConnId_t connId)
Setup connection specific variables.
unsigned long uint32_t
Unsigned 32-bit value.
Definition: wsf_types.h:71
void CppsSetSensorLocation(uint8_t location)
Set the sensor location attribute.
void CppsSetParameter(uint8_t type, uint32_t value)
Set a cycle measurement parameter.
unsigned char uint8_t
Unsigned 8-bit value.
Definition: wsf_types.h:63