Go to the documentation of this file.
64 #include "custom_config.h"
72 #define RSCS_C_CONNECTION_MAX 10
73 #define RSCS_C_PT_RSP_LEN_MAX (3 + RSCS_C_SENSOR_LOC_SUP_NB)
74 #define RSCS_C_ERROR_PROC_IN_PROGRESS 0x80
75 #define RSCS_C_ERROR_CCCD_INVALID 0x81
82 #define RSCS_C_MEAS_FLAG_INST_STRIDE_LEN_BIT (0x01 << 0)
83 #define RSCS_C_MEAS_FLAG_TOTAL_DISTANCE_BIT (0x01 << 1)
84 #define RSCS_C_MEAS_FLAG_RUNNING_OR_WALKING_BIT (0x01 << 2)
92 #define RSCS_C_FEAT_INSTANT_STRIDE_LEN_BIT (0x01 << 0)
93 #define RSCS_C_FEAT_TOTAL_DISTANCE_BIT (0x01 << 1)
94 #define RSCS_C_FEAT_RUNNING_OR_WALKING_STATUS_BIT (0x01 << 2)
95 #define RSCS_C_FEAT_CALIBRATION_PROCEDURE_BIT (0x01 << 3)
96 #define RSCS_C_FEAT_MULTIPLE_SENSORS_BIT (0x01 << 4)
@ RSCS_C_SENSOR_LOC_SHOE_TOP
Sensor location: top of shoe.
#define RSCS_C_PT_RSP_LEN_MAX
Maximum length of SC Control Point response value.
@ RSCS_C_SENSOR_LOC_LEFT_PEDAL
Sensor location: left pedal.
@ RSCS_C_EVT_DISCOVERY_COMPLETE
RSCS Client has found RSCS service and its characteristics.
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
Reserved for future use.
@ RSCS_C_CTRL_PT_OP_START_CALIB
Start Sensor Calibration Operation Code.
@ RSCS_C_SENSOR_LOC_SUP_NB
Number of sensor location.
uint16_t rscs_rsc_meas_handle
RSCS RSC Measurement characteristic Value handle which has been got from peer.
@ RSCS_C_EVT_CTRL_PT_IND_SET_SUCCESS
RSCS Client has set Indication of Control Point characteristic.
@ RSCS_C_SENSOR_LOC_SHOE_IN
Sensor location: inside of shoe.
uint16_t rscs_ctrl_pt_cccd_handle
RSCS CCCD handle of Control Point characteristic which has been got from peer.
uint16_t rscs_sensor_loc_handle
RSCS Sensor Location characteristic Value handle which has been got from peer.
sdk_err_t rscs_c_rsc_meas_notify_set(uint8_t conn_idx, bool is_enable)
Enable or disable peer RSC Measurement characteristic notify.
sdk_err_t rscs_c_rsc_feature_read(uint8_t conn_idx)
Read RSC Feature characteristic value.
rscs_c_sensor_loc_t
Running Speed and Cadence Service Sensor Location.
@ RSCS_C_CTRL_PT_RSP_RESERVED
Reserved value.
uint16_t rsc_feature
RSC feature received.
rscs_c_meas_val_t rsc_meas_buff
Buffer of RSC measurement value.
sdk_err_t rscs_client_init(rscs_c_evt_handler_t evt_handler)
Register RSCS Client event handler.
uint16_t rscs_rsc_meas_cccd_handle
RSCS CCCD handle of RSC Measurement characteristic which has been got from peer.
rscs_c_evt_type_t evt_type
RSCS Client event type.
rscs_c_sensor_loc_t rsc_sensor_loc
RSC sensor location received.
bool is_run_or_walk
True: Running, False: Walking.
rscs_c_evt_type_t
Running Speed and Cadence Service Client event type.
Handles on the connected peer device needed to interact with it.
uint32_t total_distance
Total Distance.
rscs_c_ctrl_pt_rsp_t
Running Speed and Cadence Service Control Point Response value.
@ RSCS_C_EVT_RSC_MEAS_NTF_SET_SUCCESS
RSCS Client has set Notification of RSC Measure characteristic.
@ RSCS_C_SENSOR_LOC_HIP
Sensor location: hip.
@ RSCS_C_SENSOR_LOC_FRONT_WHEEL
Sensor location: front wheel.
Running Speed and Cadence Measurement Character value structure.
@ RSCS_C_CTRL_PT_RSP_SUCCESS
Operation Succeeded.
@ RSCS_C_CTRL_PT_RSP_INVALID_PARAM
Invalid Parameter.
bool total_distance_present
If Total Distance is present.
@ RSCS_C_EVT_WRITE_OP_ERR
Error occured when RSCS Client writen to peer.
@ RSCS_C_EVT_CTRL_PT_SET_SUCCESS
RSCS Client has writen Control Point completely.
uint16_t rscs_srvc_start_handle
RSCS Service start handle.
@ RSCS_C_EVT_RSC_FEATURE_RECEIVE
RSCS Client has received RSC Feature Value read response.
uint16_t rscs_srvc_end_handle
RSCS Service end handle.
uint8_t inst_cadence
Instantaneous Cadence.
@ RSCS_C_CTRL_PT_OP_REQ_SUP_LOC
Request Supported Sensor Locations Operation Code.
@ RSCS_C_EVT_SENSOR_LOC_RECEIVE
RSCS Client has received Sensor Location Value read response.
@ RSCS_C_EVT_RSC_MEAS_VAL_RECEIVE
RSCS Client has received RSC Measurement value notification from peer.
Profile/Service Common Types.
uint16_t sdk_err_t
SDK API result type.
@ RSCS_C_CTRL_PT_OP_UPD_LOC
Update Sensor Location Operation Code.
@ RSCS_C_EVT_CTRL_PT_RSP_RECEIVE
RSCS Client has received Indication of Control Point characteristic.
Running Speed and Cadence Service Client event.
rscs_c_ctrl_pt_op_code_t
Running Speed and Cadence Service Control Point Operation Code.
uint16_t inst_speed
Instantaneous Speed.
@ RSCS_C_CTRL_PT_RSP_FAILED
Operation Failed.
uint16_t inst_stride_length
Instantaneous Stride Length.
@ RSCS_C_CTRL_PT_OP_RSP_CODE
Response code.
@ RSCS_C_SENSOR_LOC_RIGHT_PEDAL
Sensor location: right pedal.
bool inst_stride_length_present
If Instantaneous Stride Length is present.
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 Client found RSCS service failed because of invalid operation or no found at the peer.
uint16_t rscs_ctrl_pt_handle
RSCS Control Point characteristic Value handle which has been got from peer.
@ RSCS_C_CTRL_PT_OP_SET_CUMUL_VAL
Set Cumulative value Operation Code.
void(* rscs_c_evt_handler_t)(rscs_c_evt_t *p_evt)
Running Speed and Cadence Service Client event handler type.
@ RSCS_C_SENSOR_LOC_FRONT_HUB
Sensor location: front hub.
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
Sensor location: other.
uint8_t conn_idx
The connection index.
uint16_t rscs_rsc_feature_handle
RSCS RSC Feature characteristic Value handle which has been got from peer.
sdk_err_t rscs_c_sensor_loc_read(uint8_t conn_idx)
Read Sensor Location characteristic value.
@ RSCS_C_CTRL_PT_RSP_NOT_SUP
Operation Code Not Supported.
uint16_t handle
Handle of characteristic.