Bluetooth LE Profile API document
Bluetooth LE Profile API document Rev.1.00 [May 22, 2020]
Cycling Speed and Cadence Service Client

This is the client for the Cycling Speed and Cadence Service Service. More...

Detailed Description

This is the client for the Cycling Speed and Cadence Service Service.

Data Structures

struct  st_ble_cscc_csc_measurement_t
 CSC Measurement value structure. More...
 
struct  st_ble_cscc_csc_meas_attr_hdl_t
 CSC Measurement attribute handle value. More...
 
struct  st_ble_cscc_csc_feature_t
 CSC Feature value structure. More...
 
struct  st_ble_cscc_csc_feat_attr_hdl_t
 CSC Feature attribute handle value. More...
 
struct  st_ble_cscc_sen_loc_attr_hdl_t
 Sensor Location attribute handle value. More...
 
struct  st_ble_cscc_sc_control_point_t
 SC Control Point value structure. More...
 
struct  st_ble_cscc_sc_cp_attr_hdl_t
 SC Control Point attribute handle value. More...
 
struct  st_ble_cscc_evt_data_t
 Cycling Speed and Cadence Service client event data. More...
 

Macros

#define BLE_CSCC_SC_CONTROL_POINT_CUMULATIVE_VALUE_LEN   (17)
 Cumulative_value length . More...
 
#define BLE_CSCC_SC_CONTROL_POINT_RESPONSE_PARAMETER_LEN   (17)
 Response Parameter length . More...
 
#define BLE_CSCC_MAX_SENSOR_LOCATIONS_SUPPORTED   (17)
 Max No of Supported Sensor Locations. More...
 
#define BLE_CSCC_CSC_MEASUREMENT_UUID   (0x2A5B)
 
#define BLE_CSCC_CSC_MEASUREMENT_LEN   (2)
 
#define BLE_CSCC_CSC_MEASUREMENT_CLI_CNFG_UUID   (0x2902)
 
#define BLE_CSCC_CSC_MEASUREMENT_CLI_CNFG_LEN   (2)
 
#define BLE_CSCC_CSC_FEATURE_UUID   (0x2A5C)
 
#define BLE_CSCC_CSC_FEATURE_LEN   (2)
 
#define BLE_CSCC_SENSOR_LOCATION_UUID   (0x2A5D)
 
#define BLE_CSCC_SENSOR_LOCATION_LEN   (1)
 
#define BLE_CSCC_SC_CONTROL_POINT_UUID   (0x2A55)
 
#define BLE_CSCC_SC_CONTROL_POINT_LEN   (20)
 
#define BLE_CSCC_SC_CONTROL_POINT_CLI_CNFG_UUID   (0x2902)
 
#define BLE_CSCC_SC_CONTROL_POINT_CLI_CNFG_LEN   (2)
 
#define BLE_CSCC_PROCEDURE_ALREADY_IN_PROGRESS_ERROR   (BLE_ERR_GROUP_GATT | 0x80)
 
#define BLE_CSCC_CLIENT_CHARACTERISTIC_CONFIGURATION_DESCRIPTOR_IMPROPERLY_CONFIGURED_ERROR   (BLE_ERR_GROUP_GATT | 0x81)
 

Enumerations

enum  e_ble_sensor_location_sen_loc_t {
  BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION_OTHER = 0,
  BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION_TOP_OF_SHOE = 1,
  BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION_IN_SHOE = 2,
  BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION_HIP = 3,
  BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION__FRONT_WHEEL = 4,
  BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION_LEFT_CRANK = 5,
  BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION_RIGHT_CRANK = 6,
  BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION_LEFT_PEDAL = 7,
  BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION_RIGHT_PEDAL = 8,
  BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION__FRONT_HUB = 9,
  BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION_REAR_DROPOUT = 10,
  BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION_CHAINSTAY = 11,
  BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION_REAR_WHEEL = 12,
  BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION_REAR_HUB = 13,
  BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION_CHEST = 14,
  BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION_SPIDER = 15,
  BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION_CHAIN_RING = 16
}
 
enum  e_ble_cscc_sc_cp_op_code_t {
  BLE_CSCC_SC_CONTROL_POINT_OP_CODE_RESERVED_FOR_FUTURE_USE = 0,
  BLE_CSCC_SC_CONTROL_POINT_OP_CODE_SET_CUMULATIVE_VALUE = 1,
  BLE_CSCC_SC_CONTROL_POINT_OP_CODE_START_SENSOR_CALIBRATION = 2,
  BLE_CSCC_SC_CONTROL_POINT_OP_CODE_UPDATE_SENSOR_LOCATION = 3,
  BLE_CSCC_SC_CONTROL_POINT_OP_CODE_REQUEST_SUPPORTED_SENSOR_LOCATIONS = 4,
  BLE_CSCC_SC_CONTROL_POINT_OP_CODE_RESPONSE_CODE = 16
}
 
enum  e_ble_cscc_sc_cp_response_value_t {
  BLE_CSCC_SC_CONTROL_POINT_RESPONSE_VALUE_RESERVED_FOR_FUTURE_USE__RESPONSE_PARAMETER__N_A_ = 0,
  BLE_CSCC_SC_CONTROL_POINT_RESPONSE_VALUE_SUCCESS__RESPONSE_PARAMETER__NONE = 1,
  BLE_CSCC_SC_CONTROL_POINT_RESPONSE_VALUE_OP_CODE_NOT_SUPPORTED__RESPONSE_PARAMETER__N_A_ = 2,
  BLE_CSCC_SC_CONTROL_POINT_RESPONSE_VALUE_INVALID_PARAMETER__RESPONSE_PARAMETER__NONE_ = 3,
  BLE_CSCC_SC_CONTROL_POINT_RESPONSE_VALUE_OPERATION_FAILED__RESPONSE_PARAMETER__NONE_ = 4
}
 SC Control Point Response Value enumeration. More...
 
enum  e_ble_cscc_char_idx_t {
  BLE_CSCC_CSC_MEASUREMENT_IDX,
  BLE_CSCC_CSC_MEASUREMENT_CLI_CNFG_IDX,
  BLE_CSCC_CSC_FEATURE_IDX,
  BLE_CSCC_SENSOR_LOCATION_IDX,
  BLE_CSCC_SC_CONTROL_POINT_IDX,
  BLE_CSCC_SC_CONTROL_POINT_CLI_CNFG_IDX
}
 Cycling Speed and Cadence Service characteristic ID. More...
 
enum  e_ble_cscc_event_t {
  BLE_CSCC_EVENT_CSC_MEASUREMENT_HDL_VAL_NTF = BLE_SERVC_ATTR_EVENT(BLE_CSCC_CSC_MEASUREMENT_IDX, BLE_SERVC_HDL_VAL_NTF),
  BLE_CSCC_EVENT_CSC_MEASUREMENT_CLI_CNFG_READ_RSP = BLE_SERVC_ATTR_EVENT(BLE_CSCC_CSC_MEASUREMENT_CLI_CNFG_IDX, BLE_SERVC_READ_RSP),
  BLE_CSCC_EVENT_CSC_MEASUREMENT_CLI_CNFG_WRITE_RSP = BLE_SERVC_ATTR_EVENT(BLE_CSCC_CSC_MEASUREMENT_CLI_CNFG_IDX, BLE_SERVC_WRITE_RSP),
  BLE_CSCC_EVENT_CSC_FEATURE_READ_RSP = BLE_SERVC_ATTR_EVENT(BLE_CSCC_CSC_FEATURE_IDX, BLE_SERVC_READ_RSP),
  BLE_CSCC_EVENT_SENSOR_LOCATION_READ_RSP = BLE_SERVC_ATTR_EVENT(BLE_CSCC_SENSOR_LOCATION_IDX, BLE_SERVC_READ_RSP),
  BLE_CSCC_EVENT_SC_CONTROL_POINT_WRITE_RSP = BLE_SERVC_ATTR_EVENT(BLE_CSCC_SC_CONTROL_POINT_IDX, BLE_SERVC_WRITE_RSP),
  BLE_CSCC_EVENT_SC_CONTROL_POINT_HDL_VAL_IND = BLE_SERVC_ATTR_EVENT(BLE_CSCC_SC_CONTROL_POINT_IDX, BLE_SERVC_HDL_VAL_IND),
  BLE_CSCC_EVENT_SC_CONTROL_POINT_CLI_CNFG_READ_RSP = BLE_SERVC_ATTR_EVENT(BLE_CSCC_SC_CONTROL_POINT_CLI_CNFG_IDX, BLE_SERVC_READ_RSP),
  BLE_CSCC_EVENT_SC_CONTROL_POINT_CLI_CNFG_WRITE_RSP = BLE_SERVC_ATTR_EVENT(BLE_CSCC_SC_CONTROL_POINT_CLI_CNFG_IDX, BLE_SERVC_WRITE_RSP)
}
 Cycling Speed and Cadence Service client event type. More...
 

Functions

ble_status_t R_BLE_CSCC_ReadCsc_measCliCnfg (uint16_t conn_hdl)
 Read CSC Measurement characteristic Client Characteristic Configuration descriptor value from the remote GATT database. More...
 
ble_status_t R_BLE_CSCC_WriteCsc_measCliCnfg (uint16_t conn_hdl, const uint16_t *p_value)
 Write CSC Measurement characteristic Client Characteristic Configuration descriptor value to remote GATT database. More...
 
void R_BLE_CSCC_GetCsc_measurementAttrHdl (const st_ble_dev_addr_t *p_addr, st_ble_cscc_csc_meas_attr_hdl_t *p_hdl)
 Get CSC Measurement attribute handles. More...
 
ble_status_t R_BLE_CSCC_ReadCsc_feature (uint16_t conn_hdl)
 Read CSC Feature characteristic value from the remote GATT database. More...
 
void R_BLE_CSCC_GetCsc_featureAttrHdl (const st_ble_dev_addr_t *p_addr, st_ble_cscc_csc_feat_attr_hdl_t *p_hdl)
 Get CSC Feature attribute handles. More...
 
ble_status_t R_BLE_CSCC_ReadSensor_location (uint16_t conn_hdl)
 Read Sensor Location characteristic value from the remote GATT database. More...
 
void R_BLE_CSCC_GetSensor_locationAttrHdl (const st_ble_dev_addr_t *p_addr, st_ble_cscc_sen_loc_attr_hdl_t *p_hdl)
 Get Sensor Location attribute handles. More...
 
ble_status_t R_BLE_CSCC_ReadSc_control_pointCliCnfg (uint16_t conn_hdl)
 Read SC Control Point characteristic Client Characteristic Configuration descriptor value from the remote GATT database. More...
 
ble_status_t R_BLE_CSCC_WriteSc_control_pointCliCnfg (uint16_t conn_hdl, const uint16_t *p_value)
 Write SC Control Point characteristic Client Characteristic Configuration descriptor value to remote GATT database. More...
 
ble_status_t R_BLE_CSCC_WriteSc_control_point (uint16_t conn_hdl, const st_ble_cscc_sc_control_point_t *p_value)
 Write SC Control Point characteristic value to remote GATT database. More...
 
void R_BLE_CSCC_GetSc_control_pointAttrHdl (const st_ble_dev_addr_t *p_addr, st_ble_cscc_sc_cp_attr_hdl_t *p_hdl)
 Get SC Control Point attribute handles. More...
 
ble_status_t R_BLE_CSCC_Init (ble_servc_app_cb_t cb)
 Initialize Cycling Speed and Cadence Service client. More...
 
void R_BLE_CSCC_ServDiscCb (uint16_t conn_hdl, uint8_t serv_idx, uint16_t type, void *p_param)
 Cycling Speed and Cadence Service client discovery callback. More...
 
void R_BLE_CSCC_GetServAttrHdl (const st_ble_dev_addr_t *p_addr, st_ble_gatt_hdl_range_t *p_hdl)
 Get Cycling Speed and Cadence Service client attribute handle. More...
 

Macro Definition Documentation

◆ BLE_CSCC_SC_CONTROL_POINT_CUMULATIVE_VALUE_LEN

#define BLE_CSCC_SC_CONTROL_POINT_CUMULATIVE_VALUE_LEN   (17)

Cumulative_value length .

◆ BLE_CSCC_SC_CONTROL_POINT_RESPONSE_PARAMETER_LEN

#define BLE_CSCC_SC_CONTROL_POINT_RESPONSE_PARAMETER_LEN   (17)

Response Parameter length .

◆ BLE_CSCC_MAX_SENSOR_LOCATIONS_SUPPORTED

#define BLE_CSCC_MAX_SENSOR_LOCATIONS_SUPPORTED   (17)

Max No of Supported Sensor Locations.

Enumeration Type Documentation

◆ e_ble_sensor_location_sen_loc_t

Enumerator
BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION_OTHER 

Other

BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION_TOP_OF_SHOE 

Top of shoe

BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION_IN_SHOE 

In shoe

BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION_HIP 

Hip

BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION__FRONT_WHEEL 

Front Wheel

BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION_LEFT_CRANK 

Left Crank

BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION_RIGHT_CRANK 

Right Crank

BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION_LEFT_PEDAL 

Left Pedal

BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION_RIGHT_PEDAL 

Right Pedal

BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION__FRONT_HUB 

Front Hub

BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION_REAR_DROPOUT 

Rear Dropout

BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION_CHAINSTAY 

Chainstay

BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION_REAR_WHEEL 

Rear Wheel

BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION_REAR_HUB 

Rear Hub

BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION_CHEST 

Chest

BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION_SPIDER 

Spider

BLE_CSCC_SENSOR_LOCATION_SENSOR_LOCATION_CHAIN_RING 

Chain Ring

◆ e_ble_cscc_sc_cp_op_code_t

Enumerator
BLE_CSCC_SC_CONTROL_POINT_OP_CODE_RESERVED_FOR_FUTURE_USE 

Reserved for future use

BLE_CSCC_SC_CONTROL_POINT_OP_CODE_SET_CUMULATIVE_VALUE 

Set Cumulative Value

BLE_CSCC_SC_CONTROL_POINT_OP_CODE_START_SENSOR_CALIBRATION 

Start Sensor Calibration

BLE_CSCC_SC_CONTROL_POINT_OP_CODE_UPDATE_SENSOR_LOCATION 

Update Sensor Location

BLE_CSCC_SC_CONTROL_POINT_OP_CODE_REQUEST_SUPPORTED_SENSOR_LOCATIONS 

Request Supported Sensor Locations

BLE_CSCC_SC_CONTROL_POINT_OP_CODE_RESPONSE_CODE 

Response Code

◆ e_ble_cscc_sc_cp_response_value_t

SC Control Point Response Value enumeration.

Enumerator
BLE_CSCC_SC_CONTROL_POINT_RESPONSE_VALUE_RESERVED_FOR_FUTURE_USE__RESPONSE_PARAMETER__N_A_ 

Reserved For Future Use (Response Parameter: N/A)

BLE_CSCC_SC_CONTROL_POINT_RESPONSE_VALUE_SUCCESS__RESPONSE_PARAMETER__NONE 

Success

BLE_CSCC_SC_CONTROL_POINT_RESPONSE_VALUE_OP_CODE_NOT_SUPPORTED__RESPONSE_PARAMETER__N_A_ 

Op Code not supported (Response Parameter: N/A)

BLE_CSCC_SC_CONTROL_POINT_RESPONSE_VALUE_INVALID_PARAMETER__RESPONSE_PARAMETER__NONE_ 

Invalid Parameter (Response Parameter: None)

BLE_CSCC_SC_CONTROL_POINT_RESPONSE_VALUE_OPERATION_FAILED__RESPONSE_PARAMETER__NONE_ 

Operation Failed (Response Parameter: None)

◆ e_ble_cscc_char_idx_t

Cycling Speed and Cadence Service characteristic ID.

◆ e_ble_cscc_event_t

Cycling Speed and Cadence Service client event type.

Function Documentation

◆ R_BLE_CSCC_ReadCsc_measCliCnfg()

ble_status_t R_BLE_CSCC_ReadCsc_measCliCnfg ( uint16_t  conn_hdl)

Read CSC Measurement characteristic Client Characteristic Configuration descriptor value from the remote GATT database.

Parameters
[in]conn_hdlConnection handle.
Returns
ble_status_t

◆ R_BLE_CSCC_WriteCsc_measCliCnfg()

ble_status_t R_BLE_CSCC_WriteCsc_measCliCnfg ( uint16_t  conn_hdl,
const uint16_t *  p_value 
)

Write CSC Measurement characteristic Client Characteristic Configuration descriptor value to remote GATT database.

Parameters
[in]conn_hdlConnection handle.
[in]p_valueCSC Measurement characteristic Client Characteristic Configuration descriptor value to write.
Returns
ble_status_t

◆ R_BLE_CSCC_GetCsc_measurementAttrHdl()

void R_BLE_CSCC_GetCsc_measurementAttrHdl ( const st_ble_dev_addr_t p_addr,
st_ble_cscc_csc_meas_attr_hdl_t p_hdl 
)

Get CSC Measurement attribute handles.

Parameters
[in]p_addrBluetooth device address for the attribute handles.
[out]p_hdlThe pointer to store the retrieved attribute handles.
Returns
ble_status_t

◆ R_BLE_CSCC_ReadCsc_feature()

ble_status_t R_BLE_CSCC_ReadCsc_feature ( uint16_t  conn_hdl)

Read CSC Feature characteristic value from the remote GATT database.

Parameters
[in]conn_hdlConnection handle.
Returns
ble_status_t

◆ R_BLE_CSCC_GetCsc_featureAttrHdl()

void R_BLE_CSCC_GetCsc_featureAttrHdl ( const st_ble_dev_addr_t p_addr,
st_ble_cscc_csc_feat_attr_hdl_t p_hdl 
)

Get CSC Feature attribute handles.

Parameters
[in]p_addrBluetooth device address for the attribute handles.
[out]p_hdlThe pointer to store the retrieved attribute handles.
Returns
ble_status_t

◆ R_BLE_CSCC_ReadSensor_location()

ble_status_t R_BLE_CSCC_ReadSensor_location ( uint16_t  conn_hdl)

Read Sensor Location characteristic value from the remote GATT database.

Parameters
[in]conn_hdlConnection handle.
Returns
ble_status_t

◆ R_BLE_CSCC_GetSensor_locationAttrHdl()

void R_BLE_CSCC_GetSensor_locationAttrHdl ( const st_ble_dev_addr_t p_addr,
st_ble_cscc_sen_loc_attr_hdl_t p_hdl 
)

Get Sensor Location attribute handles.

Parameters
[in]p_addrBluetooth device address for the attribute handles.
[out]p_hdlThe pointer to store the retrieved attribute handles.
Returns
ble_status_t

◆ R_BLE_CSCC_ReadSc_control_pointCliCnfg()

ble_status_t R_BLE_CSCC_ReadSc_control_pointCliCnfg ( uint16_t  conn_hdl)

Read SC Control Point characteristic Client Characteristic Configuration descriptor value from the remote GATT database.

Parameters
[in]conn_hdlConnection handle.
Returns
ble_status_t

◆ R_BLE_CSCC_WriteSc_control_pointCliCnfg()

ble_status_t R_BLE_CSCC_WriteSc_control_pointCliCnfg ( uint16_t  conn_hdl,
const uint16_t *  p_value 
)

Write SC Control Point characteristic Client Characteristic Configuration descriptor value to remote GATT database.

Parameters
[in]conn_hdlConnection handle.
[in]p_valuepointer to SC Control Point characteristic Client Characteristic Configuration descriptor value to write.
Returns
ble_status_t

◆ R_BLE_CSCC_WriteSc_control_point()

ble_status_t R_BLE_CSCC_WriteSc_control_point ( uint16_t  conn_hdl,
const st_ble_cscc_sc_control_point_t p_value 
)

Write SC Control Point characteristic value to remote GATT database.

Parameters
[in]conn_hdlConnection handle.
[in]p_valueSC Control Point characteristic value to write.
Returns
ble_status_t

◆ R_BLE_CSCC_GetSc_control_pointAttrHdl()

void R_BLE_CSCC_GetSc_control_pointAttrHdl ( const st_ble_dev_addr_t p_addr,
st_ble_cscc_sc_cp_attr_hdl_t p_hdl 
)

Get SC Control Point attribute handles.

Parameters
[in]p_addrBluetooth device address for the attribute handles.
[out]p_hdlThe pointer to store the retrieved attribute handles.
Returns
ble_status_t

◆ R_BLE_CSCC_Init()

ble_status_t R_BLE_CSCC_Init ( ble_servc_app_cb_t  cb)

Initialize Cycling Speed and Cadence Service client.

Parameters
[in]cbClient callback.
Returns
ble_status_t

Function Name: R_BLE_CSCC_Init Description : This function initializes the GATTS Server and CGM Service, registers the callback function for GATTS. Arguments : cb - cal back to the initialization parameters data Return Value : BLE_SUCCESS - Success BLE_ERR_INVALID_PTR - The p_ntf_data parameter or the value field in the value field in the p_ntf_data parameter is NULL. BLE_ERR_INVALID_ARG - The value_len field in the value field in the p_ntf_data parameter is 0 or the attr_hdl field in the p_ntf_data parameters is 0.

◆ R_BLE_CSCC_ServDiscCb()

void R_BLE_CSCC_ServDiscCb ( uint16_t  conn_hdl,
uint8_t  serv_idx,
uint16_t  type,
void *  p_param 
)

Cycling Speed and Cadence Service client discovery callback.

Parameters
[in]conn_hdlConnection handle
[in]serv_idxService instance index.
[in]typeService discovery event type.
[out]p_parampointer to Service discovery event parameter.
Returns
ble_status_t

Function Name: R_BLE_CSCC_ServDiscCb Description : Callback function for the Continuous Glucose Monitoring Service Discovery events. Arguments : conn_hdl - handle to the connection type - discovery event id : p_param - pointer to GATTC event data : serv_idx - Service index used to distinguish the multiple same UUID service. Return Value : none

◆ R_BLE_CSCC_GetServAttrHdl()

void R_BLE_CSCC_GetServAttrHdl ( const st_ble_dev_addr_t p_addr,
st_ble_gatt_hdl_range_t p_hdl 
)

Get Cycling Speed and Cadence Service client attribute handle.

Parameters
[in]p_addrBluetooth device address for the attribute handles.
[out]p_hdlThe pointer to store the retrieved attribute handles.