Go to the documentation of this file.
62 #include "custom_config.h"
70 #define CSCS_CONNECTION_MAX 10
71 #define CSCS_MEAS_VAL_LEN_MAX 20
72 #define CSCS_FEAT_VAL_LEN_MAX 2
73 #define CSCS_SENSOR_LOC_VAL_LEN_MAX 1
74 #define CSCS_CTRL_PT_RSP_LEN_MIN 3
75 #define CSCS_CTRL_PT_VAL_LEN_MAX (CSCS_CTRL_PT_RSP_LEN_MIN + CSCS_SENSOR_LOC_SUP_NB)
77 #define CSCS_ERROR_PROC_IN_PROGRESS 0x80
78 #define CSCS_ERROR_CCCD_INVALID 0x81
85 #define CSCS_CHAR_MANDATORY 0x003f
86 #define CSCS_CHAR_SENSOR_LOC_SUP 0x00c0
87 #define CSCS_CHAR_SC_CTRL_POINT 0x0700
88 #define CSCS_CHAR_FULL 0x07ff
96 #define CSCS_MEAS_FLAG_WHEEL_REVOLUTION_BIT (0x01 << 0)
97 #define CSCS_MEAS_FLAG_CRANK_REVOLUTION_BIT (0x01 << 1)
105 #define CSCS_FEAT_WHEEL_REVOLUTION_SUP_BIT (0x01 << 0)
106 #define CSCS_FEAT_CRANK_REVOLUTION_SUP_BIT (0x01 << 1)
107 #define CSCS_FEAT_MULTIPLE_SENSORS_BIT (0x01 << 2)
108 #define CSCS_FEAR_FULL_BIT (0x07)
@ CSCS_SENSOR_LOC_SHOE_TOP
@ CSCS_CTRL_PT_RSP_RESERVED
@ CSCS_EVT_CSC_MEAS_NOTIFICATION_ENABLE
uint32_t cumulative_wheel_revs
@ CSCS_CTRL_PT_RSP_SUCCESS
@ CSCS_SENSOR_LOC_RIGHT_PEDAL
@ CSCS_CTRL_PT_RSP_NOT_SUP
cscs_ctrl_pt_op_code_t
Cycling Speed and Cadence Service Control Point Operation Code.
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
Cycling Speed and Cadence Measurement Character value structure.
cscs_evt_type_t
Cycling Speed and Cadence Service event type.
@ CSCS_CTRL_PT_OP_REQ_SUP_LOC
@ CSCS_CTRL_PT_RSP_INVALID_PARAM
uint16_t cumulative_crank_revs
cscs_sensor_loc_t sensor_location
@ CSCS_SENSOR_LOC_FRONT_HUB
@ CSCS_CTRL_PT_RSP_FAILED
@ CSCS_SENSOR_LOC_FRONT_WHEEL
cscs_ctrl_pt_rsp_t
Cycling Speed and Cadence Service Control Point Response value.
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.
@ CSCS_CTRL_PT_OP_RESERVED
@ CSCS_SENSOR_LOC_LEFT_PEDAL
@ CSCS_EVT_CTRL_POINT_INDICATION_DISABLE
cscs_evt_handler_t evt_handler
cscs_sensor_loc_t
Cycling Speed and Cadence Service Sensor Location.
uint16_t sdk_err_t
SDK API result type.
@ CSCS_EVT_CTRL_POINT_INDICATION_ENABLE
@ CSCS_CTRL_PT_OP_RSP_CODE
Cycling Speed and Cadence Service init stucture. This contains all option and data needed for initial...
@ CSCS_EVT_CTRL_POINT_RSP_CPLT
@ CSCS_EVT_CSC_MEAS_SEND_CPLT
uint16_t last_wheel_event_time
uint16_t last_crank_event_time
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.
@ CSCS_EVT_CSC_MEAS_NOTIFICATION_DISABLE
@ CSCS_SENSOR_LOC_SHOE_IN
@ CSCS_EVT_SEBSOR_CALIBRATION
bool wheel_rev_data_present
@ CSCS_CTRL_PT_OP_START_CALIB
@ CSCS_EVT_SEBSOR_LOC_UPD
@ CSCS_CTRL_PT_OP_UPD_LOC
@ CSCS_EVT_SUP_SEBSOR_LOC_REQ
@ CSCS_CTRL_PT_OP_SET_CUMUL_VAL
Cycling Speed and Cadence Service event.