rscs_c.h
Go to the documentation of this file.
1 /**
2 *****************************************************************************************
3 *
4 * @file rscs_c.h
5 *
6 * @brief Running Speed and Cadence Service Client API
7 *
8 *****************************************************************************************
9 * @attention
10 #####Copyright (c) 2019 GOODIX
11 All rights reserved.
12
13 Redistribution and use in source and binary forms, with or without
14 modification, are permitted provided that the following conditions are met:
15 * Redistributions of source code must retain the above copyright
16 notice, this list of conditions and the following disclaimer.
17 * Redistributions in binary form must reproduce the above copyright
18 notice, this list of conditions and the following disclaimer in the
19 documentation and/or other materials provided with the distribution.
20 * Neither the name of GOODIX nor the names of its contributors may be used
21 to endorse or promote products derived from this software without
22 specific prior written permission.
23
24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
28 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 POSSIBILITY OF SUCH DAMAGE.
35 *****************************************************************************************
36 */
37
38 /**
39 * @addtogroup BLE_SRV BLE Services
40 * @{
41 */
42
43 /**
44 * @defgroup BLE_SDK_RSCS_C Running Speed and Cadence Service Client (RSCS_C)
45 * @{
46 * @brief Running Speed and Cadence Service Client module.
47 *
48 * @details The Running Speed and Cadence Service Client contains the APIs and types, which can
49 * be used by the application to discovery of Heart Rate Service of peer and interact with it.
50 *
51 * The application must provide an event handler to register, then call \ref rscs_client_init().
52 * After Running Speed and Cadence Service Client discoveries peer Running Speed and Cadence Service,
53 * application can call \ref rscs_c_rsc_meas_notify_set(), then will receive Running Speed and Cadence
54 * data from peer, and can call \ref rscs_c_sensor_loc_read() and \ref rscs_c_rsc_feature_read() to get
55 * sensor location information and the supported features of the Server, also can call \ref rscs_c_ctrl_pt_set()
56 * to send control point to peer.
57 */
58
59 #ifndef __RSCS_C_H__
60 #define __RSCS_C_H__
61
62 #include "ble_prf_types.h"
63 #include "gr55xx_sys.h"
64 #include "custom_config.h"
65 #include <stdint.h>
66 #include <stdbool.h>
67
68 /**
69 * @defgroup RSCS_C_MACRO Defines
70 * @{
71 */
72 #define RSCS_C_CONNECTION_MAX (10 < CFG_MAX_CONNECTIONS ?\
73 10 : CFG_MAX_CONNECTIONS) /**< Maximum number of HRS Client connections. */
74 #define RSCS_C_PT_RSP_LEN_MAX (3 + RSCS_C_SENSOR_LOC_SUP_NB) /**< Maximum length of SC Control Point response value. */
75 #define RSCS_C_ERROR_PROC_IN_PROGRESS 0x80 /**< Error code: A previously triggered SC Control Point operation is still in progress. */
76 #define RSCS_C_ERROR_CCCD_INVALID 0x81 /**< Error code: The Client Characteristic Configuration descriptor is not configured. */
77
78 /**
79 * @defgroup RSCS_C_MEAS_FLAG_BIT Measurement Flag Bits
80 * @{
81 * @brief Running Speed and Cadence Measurement Flags.
82 */
83 #define RSCS_C_MEAS_FLAG_INST_STRIDE_LEN_BIT (0x01 << 0) /**< Flag bit for Instantaneous Stride Length Measurement. */
84 #define RSCS_C_MEAS_FLAG_TOTAL_DISTANCE_BIT (0x01 << 1) /**< Flag bit for Total Distance Measurement. */
85 #define RSCS_C_MEAS_FLAG_RUNNING_OR_WALKING_BIT (0x01 << 2) /**< Flag bit for Running or Walking. */
86 /** @} */
87
88 /**
89 * @defgroup RSCS_C_FEAT_BIT Feature Bits
90 * @{
91 * @brief Running Speed and Cadence Service feature bits.
92 */
93 #define RSCS_C_FEAT_INSTANT_STRIDE_LEN_BIT (0x01 << 0) /**< Bit for Instantaneous Stride Length Measurement Supported. */
94 #define RSCS_C_FEAT_TOTAL_DISTANCE_BIT (0x01 << 1) /**< Bit for Total Distance Measurement Supported. */
95 #define RSCS_C_FEAT_RUNNING_OR_WALKING_STATUS_BIT (0x01 << 2) /**< Bit for Running or Walking Status Supported. */
96 #define RSCS_C_FEAT_CALIBRATION_PROCEDURE_BIT (0x01 << 3) /**< Bit for Calibration Procedure Supported. */
97 #define RSCS_C_FEAT_MULTIPLE_SENSORS_BIT (0x01 << 4) /**< Bit for Multiple Sensor Locations Supported. */
98 /** @} */
99 /** @} */
100
101 /**
102 * @defgroup RSCS_C_ENUM Enumerations
103 * @{
104 */
105 /**@brief Running Speed and Cadence Service Client event type. */
106 typedef enum
107 {
108 RSCS_C_EVT_INVALID, /*<* RSCS Client invalid event. */
109 RSCS_C_EVT_DISCOVERY_COMPLETE, /**< RSCS Client has found RSCS service and its characteristics. */
110 RSCS_C_EVT_DISCOVERY_FAIL, /**< RSCS Client found RSCS service failed because of invalid operation or no found at the peer. */
111 RSCS_C_EVT_RSC_MEAS_NTF_SET_SUCCESS, /**< RSCS Client has set Notification of RSC Measure characteristic. */
112 RSCS_C_EVT_CTRL_PT_IND_SET_SUCCESS, /**< RSCS Client has set Indication of Control Point characteristic. */
113 RSCS_C_EVT_RSC_MEAS_VAL_RECEIVE, /**< RSCS Client has received RSC Measurement value notification from peer. */
114 RSCS_C_EVT_RSC_FEATURE_RECEIVE, /**< RSCS Client has received RSC Feature Value read response. */
115 RSCS_C_EVT_SENSOR_LOC_RECEIVE, /**< RSCS Client has received Sensor Location Value read response. */
116 RSCS_C_EVT_CTRL_PT_SET_SUCCESS, /**< RSCS Client has writen Control Point completely. */
117 RSCS_C_EVT_CTRL_PT_RSP_RECEIVE, /**< RSCS Client has received Indication of Control Point characteristic. */
118 RSCS_C_EVT_WRITE_OP_ERR, /**< Error occured when RSCS Client writen to peer. */
119 } rscs_c_evt_type_t;
120
121 /**@brief Running Speed and Cadence Service Sensor Location. */
122 typedef enum
123 {
124 RSCS_C_SENSOR_LOC_OTHER, /**< Sensor location: other. */
125 RSCS_C_SENSOR_LOC_SHOE_TOP, /**< Sensor location: top of shoe. */
126 RSCS_C_SENSOR_LOC_SHOE_IN, /**< Sensor location: inside of shoe. */
127 RSCS_C_SENSOR_LOC_HIP, /**< Sensor location: hip. */
128 RSCS_C_SENSOR_LOC_FRONT_WHEEL, /**< Sensor location: front wheel. */
129 RSCS_C_SENSOR_LOC_LEFT_PEDAL, /**< Sensor location: left pedal. */
130 RSCS_C_SENSOR_LOC_RIGHT_PEDAL, /**< Sensor location: right pedal. */
131 RSCS_C_SENSOR_LOC_FRONT_HUB, /**< Sensor location: front hub. */
132 RSCS_C_SENSOR_LOC_SUP_NB /**< Number of sensor location. */
133 } rscs_c_sensor_loc_t;
134
135 /**@brief Running Speed and Cadence Service Control Point Operation Code.*/
136 typedef enum
137 {
138 RSCS_C_CTRL_PT_OP_RESERVED, /**< Reserved for future use. */
139 RSCS_C_CTRL_PT_OP_SET_CUMUL_VAL, /**< Set Cumulative value Operation Code.*/
140 RSCS_C_CTRL_PT_OP_START_CALIB, /**< Start Sensor Calibration Operation Code.*/
141 RSCS_C_CTRL_PT_OP_UPD_LOC, /**< Update Sensor Location Operation Code.*/
142 RSCS_C_CTRL_PT_OP_REQ_SUP_LOC, /**< Request Supported Sensor Locations Operation Code.*/
143 RSCS_C_CTRL_PT_OP_RSP_CODE = 0x10, /**< Response code. */
144 } rscs_c_ctrl_pt_op_code_t;
145
146 /**@brief Running Speed and Cadence Service Control Point Response value.*/
147 typedef enum
148 {
149 RSCS_C_CTRL_PT_RSP_RESERVED, /**< Reserved value. */
150 RSCS_C_CTRL_PT_RSP_SUCCESS, /**< Operation Succeeded. */
151 RSCS_C_CTRL_PT_RSP_NOT_SUP, /**< Operation Code Not Supported. */
152 RSCS_C_CTRL_PT_RSP_INVALID_PARAM, /**< Invalid Parameter. */
153 RSCS_C_CTRL_PT_RSP_FAILED /**< Operation Failed. */
154 } rscs_c_ctrl_pt_rsp_t;
155 /** @} */
156
157 /**
158 * @defgroup RSCS_C_STRUCT Structures
159 * @{
160 */
161 /**@brief Running Speed and Cadence Measurement Character value structure. */
162 typedef struct
163 {
164 bool inst_stride_length_present; /**< If Instantaneous Stride Length is present. */
165 bool total_distance_present; /**< If Total Distance is present. */
166 bool is_run_or_walk; /**< True: Running, False: Walking. */
167 uint16_t inst_speed; /**< Instantaneous Speed. */
168 uint8_t inst_cadence; /**< Instantaneous Cadence. */
169 uint16_t inst_stride_length; /**< Instantaneous Stride Length. */
170 uint32_t total_distance; /**< Total Distance. */
171 } rscs_c_meas_val_t;
172
173 /**@brief Handles on the connected peer device needed to interact with it. */
174 typedef struct
175 {
176 uint16_t rscs_srvc_start_handle; /**< RSCS Service start handle. */
177 uint16_t rscs_srvc_end_handle; /**< RSCS Service end handle. */
178 uint16_t rscs_rsc_meas_handle; /**< RSCS RSC Measurement characteristic Value handle which has been got from peer. */
179 uint16_t rscs_rsc_meas_cccd_handle; /**< RSCS CCCD handle of RSC Measurement characteristic which has been got from peer. */
180 uint16_t rscs_sensor_loc_handle; /**< RSCS Sensor Location characteristic Value handle which has been got from peer. */
181 uint16_t rscs_rsc_feature_handle; /**< RSCS RSC Feature characteristic Value handle which has been got from peer. */
182 uint16_t rscs_ctrl_pt_handle; /**< RSCS Control Point characteristic Value handle which has been got from peer. */
183 uint16_t rscs_ctrl_pt_cccd_handle; /**< RSCS CCCD handle of Control Point characteristic which has been got from peer. */
184 } rscs_c_handles_t;
185
186 /**@brief Running Speed and Cadence Service Client event. */
187 typedef struct
188 {
189 uint8_t conn_idx; /**< The connection index. */
190 rscs_c_evt_type_t evt_type; /**< RSCS Client event type. */
191 uint16_t handle; /**< Handle of characteristic. */
192 union
193 {
194 rscs_c_meas_val_t rsc_meas_buff; /**< Buffer of RSC measurement value. */
195 uint16_t rsc_feature; /**< RSC feature received. */
196 rscs_c_sensor_loc_t rsc_sensor_loc; /**< RSC sensor location received. */
197 uint8_t ctrl_pt_rsp[RSCS_C_PT_RSP_LEN_MAX]; /**< SC Control Point Response. */
198 } value; /**< Decoded result of value received. */
199
200 } rscs_c_evt_t;
201 /** @} */
202
203 /**
204 * @defgroup RSCS_C_TYPEDEF Typedefs
205 * @{
206 */
207 /**@brief Running Speed and Cadence Service Client event handler type. */
208 typedef void (*rscs_c_evt_handler_t)(rscs_c_evt_t *p_evt);
209 /** @} */
210
211 /**
212 * @defgroup RSCS_C_FUNCTION Functions
213 * @{
214 */
215 /**
216 *****************************************************************************************
217 * @brief Register RSCS Client event handler.
218 *
219 * @param[in] evt_handler: Running Speed and Cadence Service Client event handler.
220 *
221 * @return Result of initialization.
222 *****************************************************************************************
223 */
224 sdk_err_t rscs_client_init(rscs_c_evt_handler_t evt_handler);
225
226 /**
227 *****************************************************************************************
228 * @brief Discovery Running Speed and Cadence Service on peer.
229 *
230 * @param[in] conn_idx: Index of connection.
231 *
232 * @return Operation result.
233 *****************************************************************************************
234 */
235 sdk_err_t rscs_c_disc_srvc_start(uint8_t conn_idx);
236
237 /**
238 *****************************************************************************************
239 * @brief Enable or disable peer RSC Measurement characteristic notify.
240 *
241 * @param[in] conn_idx: Index of connection.
242 * @param[in] is_enable: true or false.
243 *
244 * @return Operation result.
245 *****************************************************************************************
246 */
247 sdk_err_t rscs_c_rsc_meas_notify_set(uint8_t conn_idx, bool is_enable);
248
249 /**
250 *****************************************************************************************
251 * @brief Read RSC Feature characteristic value.
252 *
253 * @param[in] conn_idx: Index of connection.
254 *
255 * @return Operation result.
256 *****************************************************************************************
257 */
258 sdk_err_t rscs_c_rsc_feature_read(uint8_t conn_idx);
259
260 /**
261 *****************************************************************************************
262 * @brief Read Sensor Location characteristic value.
263 *
264 * @param[in] conn_idx: Index of connection.
265 *
266 * @return Operation result.
267 *****************************************************************************************
268 */
269 sdk_err_t rscs_c_sensor_loc_read(uint8_t conn_idx);
270
271 /**
272 *****************************************************************************************
273 * @brief Enable or disable peer Control Point characteristic indicate.
274 *
275 * @param[in] conn_idx: Index of connection.
276 * @param[in] is_enable: True or false.
277 *
278 * @return Operation result.
279 *****************************************************************************************
280 */
281 sdk_err_t rscs_c_ctrl_pt_indicate_set(uint8_t conn_idx, bool is_enable);
282
283 /**
284 *****************************************************************************************
285 * @brief Set Control Point characteristic value.
286 *
287 * @param[in] conn_idx: Index of connection.
288 * @param[in] ctrl_value: Value of control point.
289 *
290 * @return Operation result.
291 *****************************************************************************************
292 */
293 sdk_err_t rscs_c_ctrl_pt_set(uint8_t conn_idx, uint16_t ctrl_value);
294 /** @} */
295 #endif
296 /** @} */
297 /** @} */
298
RSCS_C_SENSOR_LOC_SHOE_TOP
@ RSCS_C_SENSOR_LOC_SHOE_TOP
Sensor location: top of shoe.
Definition: rscs_c.h:125
RSCS_C_PT_RSP_LEN_MAX
#define RSCS_C_PT_RSP_LEN_MAX
Maximum length of SC Control Point response value.
Definition: rscs_c.h:74
RSCS_C_SENSOR_LOC_LEFT_PEDAL
@ RSCS_C_SENSOR_LOC_LEFT_PEDAL
Sensor location: left pedal.
Definition: rscs_c.h:129
RSCS_C_EVT_DISCOVERY_COMPLETE
@ RSCS_C_EVT_DISCOVERY_COMPLETE
RSCS Client has found RSCS service and its characteristics.
Definition: rscs_c.h:109
rscs_c_ctrl_pt_set
sdk_err_t rscs_c_ctrl_pt_set(uint8_t conn_idx, uint16_t ctrl_value)
Set Control Point characteristic value.
RSCS_C_CTRL_PT_OP_RESERVED
@ RSCS_C_CTRL_PT_OP_RESERVED
Reserved for future use.
Definition: rscs_c.h:138
RSCS_C_CTRL_PT_OP_START_CALIB
@ RSCS_C_CTRL_PT_OP_START_CALIB
Start Sensor Calibration Operation Code.
Definition: rscs_c.h:140
RSCS_C_SENSOR_LOC_SUP_NB
@ RSCS_C_SENSOR_LOC_SUP_NB
Number of sensor location.
Definition: rscs_c.h:132
rscs_c_handles_t::rscs_rsc_meas_handle
uint16_t rscs_rsc_meas_handle
RSCS RSC Measurement characteristic Value handle which has been got from peer.
Definition: rscs_c.h:178
RSCS_C_EVT_CTRL_PT_IND_SET_SUCCESS
@ RSCS_C_EVT_CTRL_PT_IND_SET_SUCCESS
RSCS Client has set Indication of Control Point characteristic.
Definition: rscs_c.h:112
RSCS_C_SENSOR_LOC_SHOE_IN
@ RSCS_C_SENSOR_LOC_SHOE_IN
Sensor location: inside of shoe.
Definition: rscs_c.h:126
rscs_c_handles_t::rscs_ctrl_pt_cccd_handle
uint16_t rscs_ctrl_pt_cccd_handle
RSCS CCCD handle of Control Point characteristic which has been got from peer.
Definition: rscs_c.h:183
rscs_c_handles_t::rscs_sensor_loc_handle
uint16_t rscs_sensor_loc_handle
RSCS Sensor Location characteristic Value handle which has been got from peer.
Definition: rscs_c.h:180
rscs_c_rsc_meas_notify_set
sdk_err_t rscs_c_rsc_meas_notify_set(uint8_t conn_idx, bool is_enable)
Enable or disable peer RSC Measurement characteristic notify.
rscs_c_rsc_feature_read
sdk_err_t rscs_c_rsc_feature_read(uint8_t conn_idx)
Read RSC Feature characteristic value.
rscs_c_sensor_loc_t
rscs_c_sensor_loc_t
Running Speed and Cadence Service Sensor Location.
Definition: rscs_c.h:123
RSCS_C_CTRL_PT_RSP_RESERVED
@ RSCS_C_CTRL_PT_RSP_RESERVED
Reserved value.
Definition: rscs_c.h:149
rscs_c_evt_t::rsc_feature
uint16_t rsc_feature
RSC feature received.
Definition: rscs_c.h:195
rscs_c_evt_t::rsc_meas_buff
rscs_c_meas_val_t rsc_meas_buff
Buffer of RSC measurement value.
Definition: rscs_c.h:194
rscs_client_init
sdk_err_t rscs_client_init(rscs_c_evt_handler_t evt_handler)
Register RSCS Client event handler.
rscs_c_handles_t::rscs_rsc_meas_cccd_handle
uint16_t rscs_rsc_meas_cccd_handle
RSCS CCCD handle of RSC Measurement characteristic which has been got from peer.
Definition: rscs_c.h:179
rscs_c_evt_t::evt_type
rscs_c_evt_type_t evt_type
RSCS Client event type.
Definition: rscs_c.h:190
rscs_c_evt_t::rsc_sensor_loc
rscs_c_sensor_loc_t rsc_sensor_loc
RSC sensor location received.
Definition: rscs_c.h:196
rscs_c_meas_val_t::is_run_or_walk
bool is_run_or_walk
True: Running, False: Walking.
Definition: rscs_c.h:166
gr55xx_sys.h
GR55XX System API.
rscs_c_evt_type_t
rscs_c_evt_type_t
Running Speed and Cadence Service Client event type.
Definition: rscs_c.h:107
rscs_c_handles_t
Handles on the connected peer device needed to interact with it.
Definition: rscs_c.h:175
rscs_c_meas_val_t::total_distance
uint32_t total_distance
Total Distance.
Definition: rscs_c.h:170
rscs_c_ctrl_pt_rsp_t
rscs_c_ctrl_pt_rsp_t
Running Speed and Cadence Service Control Point Response value.
Definition: rscs_c.h:148
RSCS_C_EVT_RSC_MEAS_NTF_SET_SUCCESS
@ RSCS_C_EVT_RSC_MEAS_NTF_SET_SUCCESS
RSCS Client has set Notification of RSC Measure characteristic.
Definition: rscs_c.h:111
RSCS_C_SENSOR_LOC_HIP
@ RSCS_C_SENSOR_LOC_HIP
Sensor location: hip.
Definition: rscs_c.h:127
RSCS_C_SENSOR_LOC_FRONT_WHEEL
@ RSCS_C_SENSOR_LOC_FRONT_WHEEL
Sensor location: front wheel.
Definition: rscs_c.h:128
rscs_c_meas_val_t
Running Speed and Cadence Measurement Character value structure.
Definition: rscs_c.h:163
RSCS_C_CTRL_PT_RSP_SUCCESS
@ RSCS_C_CTRL_PT_RSP_SUCCESS
Operation Succeeded.
Definition: rscs_c.h:150
RSCS_C_EVT_INVALID
@ RSCS_C_EVT_INVALID
Definition: rscs_c.h:108
RSCS_C_CTRL_PT_RSP_INVALID_PARAM
@ RSCS_C_CTRL_PT_RSP_INVALID_PARAM
Invalid Parameter.
Definition: rscs_c.h:152
rscs_c_meas_val_t::total_distance_present
bool total_distance_present
If Total Distance is present.
Definition: rscs_c.h:165
RSCS_C_EVT_WRITE_OP_ERR
@ RSCS_C_EVT_WRITE_OP_ERR
Error occured when RSCS Client writen to peer.
Definition: rscs_c.h:118
RSCS_C_EVT_CTRL_PT_SET_SUCCESS
@ RSCS_C_EVT_CTRL_PT_SET_SUCCESS
RSCS Client has writen Control Point completely.
Definition: rscs_c.h:116
rscs_c_handles_t::rscs_srvc_start_handle
uint16_t rscs_srvc_start_handle
RSCS Service start handle.
Definition: rscs_c.h:176
RSCS_C_EVT_RSC_FEATURE_RECEIVE
@ RSCS_C_EVT_RSC_FEATURE_RECEIVE
RSCS Client has received RSC Feature Value read response.
Definition: rscs_c.h:114
rscs_c_handles_t::rscs_srvc_end_handle
uint16_t rscs_srvc_end_handle
RSCS Service end handle.
Definition: rscs_c.h:177
rscs_c_meas_val_t::inst_cadence
uint8_t inst_cadence
Instantaneous Cadence.
Definition: rscs_c.h:168
RSCS_C_CTRL_PT_OP_REQ_SUP_LOC
@ RSCS_C_CTRL_PT_OP_REQ_SUP_LOC
Request Supported Sensor Locations Operation Code.
Definition: rscs_c.h:142
RSCS_C_EVT_SENSOR_LOC_RECEIVE
@ RSCS_C_EVT_SENSOR_LOC_RECEIVE
RSCS Client has received Sensor Location Value read response.
Definition: rscs_c.h:115
RSCS_C_EVT_RSC_MEAS_VAL_RECEIVE
@ RSCS_C_EVT_RSC_MEAS_VAL_RECEIVE
RSCS Client has received RSC Measurement value notification from peer.
Definition: rscs_c.h:113
ble_prf_types.h
Profile/Service Common Types.
sdk_err_t
uint16_t sdk_err_t
SDK API result type.
Definition: ble_error.h:243
RSCS_C_CTRL_PT_OP_UPD_LOC
@ RSCS_C_CTRL_PT_OP_UPD_LOC
Update Sensor Location Operation Code.
Definition: rscs_c.h:141
RSCS_C_EVT_CTRL_PT_RSP_RECEIVE
@ RSCS_C_EVT_CTRL_PT_RSP_RECEIVE
RSCS Client has received Indication of Control Point characteristic.
Definition: rscs_c.h:117
rscs_c_evt_t
Running Speed and Cadence Service Client event.
Definition: rscs_c.h:188
rscs_c_ctrl_pt_op_code_t
rscs_c_ctrl_pt_op_code_t
Running Speed and Cadence Service Control Point Operation Code.
Definition: rscs_c.h:137
rscs_c_meas_val_t::inst_speed
uint16_t inst_speed
Instantaneous Speed.
Definition: rscs_c.h:167
RSCS_C_CTRL_PT_RSP_FAILED
@ RSCS_C_CTRL_PT_RSP_FAILED
Operation Failed.
Definition: rscs_c.h:153
rscs_c_meas_val_t::inst_stride_length
uint16_t inst_stride_length
Instantaneous Stride Length.
Definition: rscs_c.h:169
RSCS_C_CTRL_PT_OP_RSP_CODE
@ RSCS_C_CTRL_PT_OP_RSP_CODE
Response code.
Definition: rscs_c.h:143
RSCS_C_SENSOR_LOC_RIGHT_PEDAL
@ RSCS_C_SENSOR_LOC_RIGHT_PEDAL
Sensor location: right pedal.
Definition: rscs_c.h:130
rscs_c_meas_val_t::inst_stride_length_present
bool inst_stride_length_present
If Instantaneous Stride Length is present.
Definition: rscs_c.h:164
rscs_c_disc_srvc_start
sdk_err_t rscs_c_disc_srvc_start(uint8_t conn_idx)
Discovery Running Speed and Cadence Service on peer.
RSCS_C_EVT_DISCOVERY_FAIL
@ RSCS_C_EVT_DISCOVERY_FAIL
RSCS Client found RSCS service failed because of invalid operation or no found at the peer.
Definition: rscs_c.h:110
rscs_c_handles_t::rscs_ctrl_pt_handle
uint16_t rscs_ctrl_pt_handle
RSCS Control Point characteristic Value handle which has been got from peer.
Definition: rscs_c.h:182
RSCS_C_CTRL_PT_OP_SET_CUMUL_VAL
@ RSCS_C_CTRL_PT_OP_SET_CUMUL_VAL
Set Cumulative value Operation Code.
Definition: rscs_c.h:139
rscs_c_evt_handler_t
void(* rscs_c_evt_handler_t)(rscs_c_evt_t *p_evt)
Running Speed and Cadence Service Client event handler type.
Definition: rscs_c.h:208
RSCS_C_SENSOR_LOC_FRONT_HUB
@ RSCS_C_SENSOR_LOC_FRONT_HUB
Sensor location: front hub.
Definition: rscs_c.h:131
rscs_c_ctrl_pt_indicate_set
sdk_err_t rscs_c_ctrl_pt_indicate_set(uint8_t conn_idx, bool is_enable)
Enable or disable peer Control Point characteristic indicate.
RSCS_C_SENSOR_LOC_OTHER
@ RSCS_C_SENSOR_LOC_OTHER
Sensor location: other.
Definition: rscs_c.h:124
rscs_c_evt_t::conn_idx
uint8_t conn_idx
The connection index.
Definition: rscs_c.h:189
rscs_c_handles_t::rscs_rsc_feature_handle
uint16_t rscs_rsc_feature_handle
RSCS RSC Feature characteristic Value handle which has been got from peer.
Definition: rscs_c.h:181
rscs_c_sensor_loc_read
sdk_err_t rscs_c_sensor_loc_read(uint8_t conn_idx)
Read Sensor Location characteristic value.
RSCS_C_CTRL_PT_RSP_NOT_SUP
@ RSCS_C_CTRL_PT_RSP_NOT_SUP
Operation Code Not Supported.
Definition: rscs_c.h:151
rscs_c_evt_t::handle
uint16_t handle
Handle of characteristic.
Definition: rscs_c.h:191