Go to the documentation of this file.
71 #define RSCS_CONNECTION_MAX 10
72 #define RSCS_MEAS_VAL_LEN_MAX 20
73 #define RSCS_FEAT_VAL_LEN_MAX 2
74 #define RSCS_SENSOR_LOC_VAL_LEN_MAX 1
75 #define RSCS_CTRL_PT_RSP_LEN_MIN 3
76 #define RSCS_CTRL_PT_VAL_LEN_MAX (RSCS_CTRL_PT_RSP_LEN_MIN + RSCS_SENSOR_LOC_SUP_NB)
78 #define RSCS_ERROR_PROC_IN_PROGRESS 0x80
79 #define RSCS_ERROR_CCCD_INVALID 0x81
86 #define RSCS_CHAR_MANDATORY 0x003f
87 #define RSCS_CHAR_SENSOR_LOC_SUP 0x00c0
88 #define RSCS_CHAR_SC_CTRL_POINT 0x0700
89 #define RSCS_CHAR_FULL 0x07ff
97 #define RSCS_MEAS_FLAG_INST_STRIDE_LEN_BIT (0x01 << 0)
98 #define RSCS_MEAS_FLAG_TOTAL_DISTANCE_BIT (0x01 << 1)
99 #define RSCS_MEAS_FLAG_RUNNING_OR_WALKING_BIT (0x01 << 2)
107 #define RSCS_FEAT_INSTANT_STRIDE_LEN_BIT (0x01 << 0)
108 #define RSCS_FEAT_TOTAL_DISTANCE_BIT (0x01 << 1)
109 #define RSCS_FEAT_RUNNING_OR_WALKING_STATUS_BIT (0x01 << 2)
110 #define RSCS_FEAT_CALIBRATION_PROCEDURE_BIT (0x01 << 3)
111 #define RSCS_FEAT_MULTIPLE_SENSORS_BIT (0x01 << 4)
112 #define RSCS_FEAR_FULL_BIT (0x1f)
rscs_ctrl_pt_rsp_t
Running Speed and Cadence Service Control Point Response value.
@ RSCS_CTRL_PT_OP_RESERVED
Reserved for future use.
@ RSCS_CTRL_PT_OP_START_CALIB
Start Sensor Calibration Operation Code.
@ RSCS_EVT_CTRL_POINT_INDICATION_DISABLE
Indicate that SC Control Point indication has been disabled.
Running Speed and Cadence Service init stucture.
bool inst_stride_length_present
If Instantaneous Stride Length is present.
@ RSCS_CTRL_PT_RSP_FAILED
Operation Failed.
rscs_sensor_loc_t sensor_location
Initial sensor location.
uint8_t conn_idx
The index of the connection.
rscs_evt_type_t evt_type
The RSCS event type.
@ RSCS_SENSOR_LOC_HIP
Sensor location: hip.
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.
@ RSCS_CTRL_PT_RSP_NOT_SUP
Operation Code Not Supported.
@ RSCS_SENSOR_LOC_OTHER
Sensor location: other.
rscs_ctrl_pt_op_code_t
Running Speed and Cadence Service Control Point Operation Code.
@ RSCS_SENSOR_LOC_LEFT_PEDAL
Sensor location: left pedal.
@ RSCS_EVT_CUMUL_VAL_SET
Indicate that Total Distance value needs to be set.
uint16_t inst_speed
Instantaneous Speed.
bool is_run_or_walk
True: Running, False: Walking.
@ RSCS_CTRL_PT_OP_UPD_LOC
Update Sensor Location Operation Code.
@ RSCS_EVT_CTRL_POINT_RSP_CPLT
Indicate that SC Control Point response has been indicated.
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
Indicate that Sensor calibration procedure should be initiated.
rscs_evt_handler_t evt_handler
Running Speed and Cadence Service event handler.
@ RSCS_CTRL_PT_OP_SET_CUMUL_VAL
Set Cumulative value Operation Code.
Running Speed and Cadence Measurement Character value structure.
@ RSCS_SENSOR_LOC_SHOE_IN
Sensor location: inside of shoe.
@ RSCS_SENSOR_LOC_FRONT_HUB
Sensor location: front hub.
uint8_t inst_cadence
Instantaneous Cadence.
@ RSCS_CTRL_PT_OP_REQ_SUP_LOC
Request Supported Sensor Locations Operation Code.
@ RSCS_EVT_SEBSOR_LOC_UPD
Indicate that Sensor Location needs to be reset.
@ RSCS_EVT_CTRL_POINT_INDICATION_ENABLE
Indicate that SC Control Point indication has been enabled.
Running Speed and Cadence Service event.
@ RSCS_SENSOR_LOC_SHOE_TOP
Sensor location: top of shoe.
@ RSCS_CTRL_PT_RSP_INVALID_PARAM
Invalid Parameter.
@ RSCS_EVT_RSC_MEAS_SEND_CPLT
Indicate that RSC Measurement has been notified.
uint16_t inst_stride_length
Instantaneous Stride Length.
@ RSCS_EVT_INVALID
Indicate that invalid event.
uint16_t sdk_err_t
SDK API result type.
@ RSCS_SENSOR_LOC_FRONT_WHEEL
Sensor location: front wheel.
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
Total Distance.
@ RSCS_SENSOR_LOC_RIGHT_PEDAL
Sensor location: right pedal.
@ RSCS_SENSOR_LOC_SUP_NB
Number of sensor location.
@ RSCS_CTRL_PT_RSP_RESERVED
Reserved value.
uint16_t char_mask
Initial mask of supported characteristics, and configured with Characteristics Mask.
@ RSCS_CTRL_PT_RSP_SUCCESS
Operation Succeeded.
@ RSCS_EVT_SUP_SEBSOR_LOC_REQ
Indicate that request supported sensor location list.
@ RSCS_CTRL_PT_OP_RSP_CODE
Response code.
uint16_t length
Length of event data.
bool total_distance_present
If Total Distance is present.
@ RSCS_EVT_RSC_MEAS_NOTIFICATION_ENABLE
Indicate that RSC Measurement notification has been enabled.
rscs_evt_type_t
Running Speed and Cadence Service event type.
@ RSCS_EVT_RSC_MEAS_NOTIFICATION_DISABLE
Indicate that RSC Measurement notification has been disabled.
const uint8_t * p_data
Pointer to event data.
void(* rscs_evt_handler_t)(rscs_evt_t *p_evt)
Running Speed and Cadence Service event handler type.
uint16_t feature
Initial value for features.
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.