Go to the documentation of this file.
62 #include "custom_config.h"
70 #define CSCS_CONNECTION_MAX (10 < CFG_MAX_CONNECTIONS ?\
71 10 : CFG_MAX_CONNECTIONS)
72 #define CSCS_MEAS_VAL_LEN_MAX 20
73 #define CSCS_FEAT_VAL_LEN_MAX 2
74 #define CSCS_SENSOR_LOC_VAL_LEN_MAX 1
75 #define CSCS_CTRL_PT_RSP_LEN_MIN 3
76 #define CSCS_CTRL_PT_VAL_LEN_MAX (CSCS_CTRL_PT_RSP_LEN_MIN + CSCS_SENSOR_LOC_SUP_NB)
78 #define CSCS_ERROR_PROC_IN_PROGRESS 0x80
79 #define CSCS_ERROR_CCCD_INVALID 0x81
86 #define CSCS_CHAR_MANDATORY 0x003f
87 #define CSCS_CHAR_SENSOR_LOC_SUP 0x00c0
88 #define CSCS_CHAR_SC_CTRL_POINT 0x0700
89 #define CSCS_CHAR_FULL 0x07ff
97 #define CSCS_MEAS_FLAG_WHEEL_REVOLUTION_BIT (0x01 << 0)
98 #define CSCS_MEAS_FLAG_CRANK_REVOLUTION_BIT (0x01 << 1)
106 #define CSCS_FEAT_WHEEL_REVOLUTION_SUP_BIT (0x01 << 0)
107 #define CSCS_FEAT_CRANK_REVOLUTION_SUP_BIT (0x01 << 1)
108 #define CSCS_FEAT_MULTIPLE_SENSORS_BIT (0x01 << 2)
109 #define CSCS_FEAR_FULL_BIT (0x07)
@ CSCS_SENSOR_LOC_SHOE_TOP
Definition: cscs.h:121
@ CSCS_CTRL_PT_RSP_RESERVED
Definition: cscs.h:145
const uint8_t * p_data
Definition: cscs.h:178
@ CSCS_EVT_CSC_MEAS_NOTIFICATION_ENABLE
Definition: cscs.h:156
uint32_t cumulative_wheel_revs
Definition: cscs.h:200
uint16_t char_mask
Definition: cscs.h:210
@ CSCS_CTRL_PT_RSP_SUCCESS
Definition: cscs.h:146
uint8_t conn_idx
Definition: cscs.h:177
@ CSCS_SENSOR_LOC_RIGHT_PEDAL
Definition: cscs.h:126
@ CSCS_CTRL_PT_RSP_NOT_SUP
Definition: cscs.h:147
cscs_ctrl_pt_op_code_t
Cycling Speed and Cadence Service Control Point Operation Code.
Definition: cscs.h:133
sdk_err_t cscs_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.
sdk_err_t cscs_measurement_send(uint8_t conn_idx, cscs_meas_val_t *p_meas)
Send CSC measurement if notification has been enabled.
bool crank_rev_data_present
Definition: cscs.h:199
Cycling Speed and Cadence Measurement Character value structure.
Definition: cscs.h:197
cscs_evt_type_t
Cycling Speed and Cadence Service event type.
Definition: cscs.h:154
@ CSCS_CTRL_PT_OP_REQ_SUP_LOC
Definition: cscs.h:138
@ CSCS_CTRL_PT_RSP_INVALID_PARAM
Definition: cscs.h:148
@ CSCS_SENSOR_LOC_HIP
Definition: cscs.h:123
uint16_t cumulative_crank_revs
Definition: cscs.h:202
cscs_sensor_loc_t sensor_location
Definition: cscs.h:211
@ CSCS_SENSOR_LOC_FRONT_HUB
Definition: cscs.h:127
@ CSCS_CTRL_PT_RSP_FAILED
Definition: cscs.h:149
@ CSCS_SENSOR_LOC_FRONT_WHEEL
Definition: cscs.h:124
cscs_ctrl_pt_rsp_t
Cycling Speed and Cadence Service Control Point Response value.
Definition: cscs.h:144
sdk_err_t cscs_sensor_loc_update(cscs_sensor_loc_t sensor_loc)
Update Sensor Location if Multiple Sensor Locations Supported cscs_init_t::feature.
void(* cscs_evt_handler_t)(cscs_evt_t *p_evt)
Cycling Speed and Cadence Service event handler type.
Definition: cscs.h:188
uint16_t feature
Definition: cscs.h:212
@ CSCS_CTRL_PT_OP_RESERVED
Definition: cscs.h:134
@ CSCS_SENSOR_LOC_LEFT_PEDAL
Definition: cscs.h:125
@ CSCS_EVT_CTRL_POINT_INDICATION_DISABLE
Definition: cscs.h:159
cscs_evt_handler_t evt_handler
Definition: cscs.h:209
cscs_sensor_loc_t
Cycling Speed and Cadence Service Sensor Location.
Definition: cscs.h:119
uint16_t sdk_err_t
SDK API result type.
Definition: ble_error.h:243
@ CSCS_EVT_CTRL_POINT_INDICATION_ENABLE
Definition: cscs.h:158
@ CSCS_CTRL_PT_OP_RSP_CODE
Definition: cscs.h:139
@ CSCS_EVT_INVALID
Definition: cscs.h:155
Cycling Speed and Cadence Service init stucture. This contains all option and data needed for initial...
Definition: cscs.h:208
@ CSCS_EVT_CTRL_POINT_RSP_CPLT
Definition: cscs.h:165
@ CSCS_EVT_CSC_MEAS_SEND_CPLT
Definition: cscs.h:160
uint16_t last_wheel_event_time
Definition: cscs.h:201
cscs_evt_type_t evt_type
Definition: cscs.h:176
uint16_t last_crank_event_time
Definition: cscs.h:203
@ CSCS_SENSOR_LOC_SUP_NB
Definition: cscs.h:128
sdk_err_t cscs_service_init(cscs_init_t *p_cscs_init)
Initialize a Cycling Speed and Cadence Service instance and add in the DB.
uint16_t length
Definition: cscs.h:179
@ CSCS_EVT_CSC_MEAS_NOTIFICATION_DISABLE
Definition: cscs.h:157
@ CSCS_SENSOR_LOC_SHOE_IN
Definition: cscs.h:122
@ CSCS_EVT_SEBSOR_CALIBRATION
Definition: cscs.h:162
bool wheel_rev_data_present
Definition: cscs.h:198
@ CSCS_CTRL_PT_OP_START_CALIB
Definition: cscs.h:136
@ CSCS_EVT_CUMUL_VAL_SET
Definition: cscs.h:161
@ CSCS_SENSOR_LOC_OTHER
Definition: cscs.h:120
@ CSCS_EVT_SEBSOR_LOC_UPD
Definition: cscs.h:163
@ CSCS_CTRL_PT_OP_UPD_LOC
Definition: cscs.h:137
@ CSCS_EVT_SUP_SEBSOR_LOC_REQ
Definition: cscs.h:164
@ CSCS_CTRL_PT_OP_SET_CUMUL_VAL
Definition: cscs.h:135
Cycling Speed and Cadence Service event.
Definition: cscs.h:175