Go to the documentation of this file.
64 #include "custom_config.h"
72 #define RSCS_CONNECTION_MAX (10 < CFG_MAX_CONNECTIONS ?\
73 10 : CFG_MAX_CONNECTIONS)
74 #define RSCS_MEAS_VAL_LEN_MAX 20
75 #define RSCS_FEAT_VAL_LEN_MAX 2
76 #define RSCS_SENSOR_LOC_VAL_LEN_MAX 1
77 #define RSCS_CTRL_PT_RSP_LEN_MIN 3
78 #define RSCS_CTRL_PT_VAL_LEN_MAX (RSCS_CTRL_PT_RSP_LEN_MIN + RSCS_SENSOR_LOC_SUP_NB)
80 #define RSCS_ERROR_PROC_IN_PROGRESS 0x80
81 #define RSCS_ERROR_CCCD_INVALID 0x81
88 #define RSCS_CHAR_MANDATORY 0x003f
89 #define RSCS_CHAR_SENSOR_LOC_SUP 0x00c0
90 #define RSCS_CHAR_SC_CTRL_POINT 0x0700
91 #define RSCS_CHAR_FULL 0x07ff
99 #define RSCS_MEAS_FLAG_INST_STRIDE_LEN_BIT (0x01 << 0)
100 #define RSCS_MEAS_FLAG_TOTAL_DISTANCE_BIT (0x01 << 1)
101 #define RSCS_MEAS_FLAG_RUNNING_OR_WALKING_BIT (0x01 << 2)
109 #define RSCS_FEAT_INSTANT_STRIDE_LEN_BIT (0x01 << 0)
110 #define RSCS_FEAT_TOTAL_DISTANCE_BIT (0x01 << 1)
111 #define RSCS_FEAT_RUNNING_OR_WALKING_STATUS_BIT (0x01 << 2)
112 #define RSCS_FEAT_CALIBRATION_PROCEDURE_BIT (0x01 << 3)
113 #define RSCS_FEAT_MULTIPLE_SENSORS_BIT (0x01 << 4)
114 #define RSCS_FEAR_FULL_BIT (0x1f)
rscs_ctrl_pt_rsp_t
Running Speed and Cadence Service Control Point Response value.
Definition: rscs.h:149
@ RSCS_CTRL_PT_OP_RESERVED
Definition: rscs.h:139
@ RSCS_CTRL_PT_OP_START_CALIB
Definition: rscs.h:141
@ RSCS_EVT_CTRL_POINT_INDICATION_DISABLE
Definition: rscs.h:164
Running Speed and Cadence Service init stucture. This contains all option and data needed for initial...
Definition: rscs.h:214
bool inst_stride_length_present
Definition: rscs.h:190
@ RSCS_CTRL_PT_RSP_FAILED
Definition: rscs.h:154
rscs_sensor_loc_t sensor_location
Definition: rscs.h:217
uint8_t conn_idx
Definition: rscs.h:182
rscs_evt_type_t evt_type
Definition: rscs.h:181
@ RSCS_SENSOR_LOC_HIP
Definition: rscs.h:128
sdk_err_t rscs_measurement_send(uint8_t conn_idx, rscs_meas_val_t *p_meas)
Send RSC measurement if notification has been enabled.
rscs_sensor_loc_t
Running Speed and Cadence Service Sensor Location.
Definition: rscs.h:124
@ RSCS_CTRL_PT_RSP_NOT_SUP
Definition: rscs.h:152
@ RSCS_SENSOR_LOC_OTHER
Definition: rscs.h:125
rscs_ctrl_pt_op_code_t
Running Speed and Cadence Service Control Point Operation Code.
Definition: rscs.h:138
@ RSCS_SENSOR_LOC_LEFT_PEDAL
Definition: rscs.h:130
@ RSCS_EVT_CUMUL_VAL_SET
Definition: rscs.h:166
uint16_t inst_speed
Definition: rscs.h:193
bool is_run_or_walk
Definition: rscs.h:192
@ RSCS_CTRL_PT_OP_UPD_LOC
Definition: rscs.h:142
@ RSCS_EVT_CTRL_POINT_RSP_CPLT
Definition: rscs.h:170
sdk_err_t rscs_ctrl_pt_rsp_send(uint8_t conn_idx, uint8_t *p_data, uint16_t length)
Send SC Control Point responce if indication has been enabled.
@ RSCS_EVT_SEBSOR_CALIBRATION
Definition: rscs.h:167
rscs_evt_handler_t evt_handler
Definition: rscs.h:215
@ RSCS_CTRL_PT_OP_SET_CUMUL_VAL
Definition: rscs.h:140
Running Speed and Cadence Measurement Character value structure.
Definition: rscs.h:189
@ RSCS_SENSOR_LOC_SHOE_IN
Definition: rscs.h:127
@ RSCS_SENSOR_LOC_FRONT_HUB
Definition: rscs.h:132
uint8_t inst_cadence
Definition: rscs.h:194
@ RSCS_CTRL_PT_OP_REQ_SUP_LOC
Definition: rscs.h:143
@ RSCS_EVT_SEBSOR_LOC_UPD
Definition: rscs.h:168
@ RSCS_EVT_CTRL_POINT_INDICATION_ENABLE
Definition: rscs.h:163
Running Speed and Cadence Service event.
Definition: rscs.h:180
@ RSCS_SENSOR_LOC_SHOE_TOP
Definition: rscs.h:126
@ RSCS_CTRL_PT_RSP_INVALID_PARAM
Definition: rscs.h:153
@ RSCS_EVT_RSC_MEAS_SEND_CPLT
Definition: rscs.h:165
uint16_t inst_stride_length
Definition: rscs.h:195
@ RSCS_EVT_INVALID
Definition: rscs.h:160
uint16_t sdk_err_t
SDK API result type.
Definition: ble_error.h:243
@ RSCS_SENSOR_LOC_FRONT_WHEEL
Definition: rscs.h:129
sdk_err_t rscs_service_init(rscs_init_t *p_rscs_init)
Initialize a Running Speed and Cadence Service instance and add in the DB.
uint32_t total_distance
Definition: rscs.h:196
@ RSCS_SENSOR_LOC_RIGHT_PEDAL
Definition: rscs.h:131
@ RSCS_SENSOR_LOC_SUP_NB
Definition: rscs.h:133
@ RSCS_CTRL_PT_RSP_RESERVED
Definition: rscs.h:150
uint16_t char_mask
Definition: rscs.h:216
@ RSCS_CTRL_PT_RSP_SUCCESS
Definition: rscs.h:151
@ RSCS_EVT_SUP_SEBSOR_LOC_REQ
Definition: rscs.h:169
@ RSCS_CTRL_PT_OP_RSP_CODE
Definition: rscs.h:144
uint16_t length
Definition: rscs.h:184
bool total_distance_present
Definition: rscs.h:191
@ RSCS_EVT_RSC_MEAS_NOTIFICATION_ENABLE
Definition: rscs.h:161
rscs_evt_type_t
Running Speed and Cadence Service event type.
Definition: rscs.h:159
@ RSCS_EVT_RSC_MEAS_NOTIFICATION_DISABLE
Definition: rscs.h:162
const uint8_t * p_data
Definition: rscs.h:183
void(* rscs_evt_handler_t)(rscs_evt_t *p_evt)
Running Speed and Cadence Service event handler type.
Definition: rscs.h:205
uint16_t feature
Definition: rscs.h:218
sdk_err_t rscs_sensor_loc_update(rscs_sensor_loc_t sensor_loc)
Update Sensor Location if Multiple Sensor Locations Supported rscs_init_t::feature.