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

This service exposes speed-related and cadence-related data from a Cycling Speed and Cadence sensor intended for fitness applications. More...

Detailed Description

This service exposes speed-related and cadence-related data from a Cycling Speed and Cadence sensor intended for fitness applications.

Data Structures

struct  st_ble_cscs_csc_measurement_t
 CSC Measurement value structure. More...
 
struct  st_ble_cscs_csc_feature_t
 CSC Feature value structure. More...
 
struct  st_ble_cscs_sc_cp_t
 SC Control Point value structure. More...
 

Macros

#define BLE_CSCS_PRV_WRITE_REQUEST_REJECTED   (BLE_ERR_GROUP_GATT | 0x82)
 Write Request Rejected error code. More...
 
#define BLE_CSCS_PRV_SC_CONTROL_POINT_RESPONSE_PARAMETER_LEN   (17)
 Response Parameter length . More...
 
#define BLE_CSCS_PRV_MAX_SENSOR_LOCATIONS_SUPPORTED   (17)
 Max No of Supported Sensor Locations. More...
 
#define BLE_CSCS_PROCEDURE_ALREADY_IN_PROGRESS_ERROR   (BLE_ERR_GROUP_GATT | 0x80)
 Procedure Already in Progress error code. More...
 
#define BLE_CSCS_CLI_CNFG_IMPROPERLY_CONFIGURED_ERROR   (BLE_ERR_GROUP_GATT | 0x81)
 Client Characteristic Configuration descriptor improperly configured error code. More...
 

Enumerations

enum  e_ble_sensor_location_t {
  BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION_OTHER = 0,
  BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION_TOP_OF_SHOE = 1,
  BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION_IN_SHOE = 2,
  BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION_HIP = 3,
  BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION__FRONT_WHEEL = 4,
  BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION_LEFT_CRANK = 5,
  BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION_RIGHT_CRANK = 6,
  BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION_LEFT_PEDAL = 7,
  BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION_RIGHT_PEDAL = 8,
  BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION__FRONT_HUB = 9,
  BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION_REAR_DROPOUT = 10,
  BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION_CHAINSTAY = 11,
  BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION_REAR_WHEEL = 12,
  BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION_REAR_HUB = 13,
  BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION_CHEST = 14,
  BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION_SPIDER = 15,
  BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION_CHAIN_RING = 16
}
 Sensor Location Sensor Location enumeration. More...
 
enum  e_ble_cscs_sc_cp_op_code_t {
  BLE_CSCS_SC_CONTROL_POINT_OP_CODE_RESERVED_FOR_FUTURE_USE = 0,
  BLE_CSCS_SC_CONTROL_POINT_OP_CODE_SET_CUMULATIVE_VALUE = 1,
  BLE_CSCS_SC_CONTROL_POINT_OP_CODE_START_SENSOR_CALIBRATION = 2,
  BLE_CSCS_SC_CONTROL_POINT_OP_CODE_UPDATE_SENSOR_LOCATION = 3,
  BLE_CSCS_SC_CONTROL_POINT_OP_CODE_REQUEST_SUPPORTED_SENSOR_LOCATIONS = 4,
  BLE_CSCS_SC_CONTROL_POINT_OP_CODE_RESPONSE_CODE = 16
}
 SC Control Point Op Code enumeration. More...
 
enum  e_ble_cscs_sc_cp_response_value_t {
  BLE_CSCS_SC_CONTROL_POINT_RESPONSE_VALUE_RESERVED_FOR_FUTURE_USE__RESPONSE_PARAMETER__N_A_ = 0,
  BLE_CSCS_SC_CONTROL_POINT_RESPONSE_VALUE_SUCCESS__RESPONSE_PARAMETER__NONE_EXCEPT_FOR_OP_CODE_0X04_SEE_NOTE_BELOW_ = 1,
  BLE_CSCS_SC_CONTROL_POINT_RESPONSE_VALUE_OP_CODE_NOT_SUPPORTED__RESPONSE_PARAMETER__N_A_ = 2,
  BLE_CSCS_SC_CONTROL_POINT_RESPONSE_VALUE_INVALID_PARAMETER__RESPONSE_PARAMETER__NONE_ = 3,
  BLE_CSCS_SC_CONTROL_POINT_RESPONSE_VALUE_OPERATION_FAILED__RESPONSE_PARAMETER__NONE_ = 4
}
 SC Control Point Response Value enumeration. More...
 
enum  e_ble_cscs_char_idx_t {
  BLE_CSCS_CSC_MEASUREMENT_IDX,
  BLE_CSCS_CSC_MEASUREMENT_CLI_CNFG_IDX,
  BLE_CSCS_CSC_FEATURE_IDX,
  BLE_CSCS_SENSOR_LOCATION_IDX,
  BLE_CSCS_SC_CONTROL_POINT_IDX,
  BLE_CSCS_SC_CONTROL_POINT_CLI_CNFG_IDX
}
 Cycling Speed and Cadence Service characteristic Index. More...
 
enum  e_ble_cscs_event_t {
  BLE_CSCS_EVENT_CSC_MEASUREMENT_CLI_CNFG_WRITE_REQ = BLE_SERVS_ATTR_EVENT(BLE_CSCS_CSC_MEASUREMENT_CLI_CNFG_IDX, BLE_SERVS_WRITE_REQ),
  BLE_CSCS_EVENT_CSC_MEASUREMENT_CLI_CNFG_WRITE_COMP = BLE_SERVS_ATTR_EVENT(BLE_CSCS_CSC_MEASUREMENT_CLI_CNFG_IDX, BLE_SERVS_WRITE_COMP),
  BLE_CSCS_EVENT_CSC_MEASUREMENT_CLI_CNFG_READ_REQ = BLE_SERVS_ATTR_EVENT(BLE_CSCS_CSC_MEASUREMENT_CLI_CNFG_IDX, BLE_SERVS_READ_REQ),
  BLE_CSCS_EVENT_CSC_FEATURE_READ_REQ = BLE_SERVS_ATTR_EVENT(BLE_CSCS_CSC_FEATURE_IDX, BLE_SERVS_READ_REQ),
  BLE_CSCS_EVENT_SENSOR_LOCATION_READ_REQ = BLE_SERVS_ATTR_EVENT(BLE_CSCS_SENSOR_LOCATION_IDX, BLE_SERVS_READ_REQ),
  BLE_CSCS_EVENT_SC_CONTROL_POINT_WRITE_REQ = BLE_SERVS_ATTR_EVENT(BLE_CSCS_SC_CONTROL_POINT_IDX, BLE_SERVS_WRITE_REQ),
  BLE_CSCS_EVENT_SC_CONTROL_POINT_WRITE_COMP = BLE_SERVS_ATTR_EVENT(BLE_CSCS_SC_CONTROL_POINT_IDX, BLE_SERVS_WRITE_COMP),
  BLE_CSCS_EVENT_SC_CONTROL_POINT_HDL_VAL_CNF = BLE_SERVS_ATTR_EVENT(BLE_CSCS_SC_CONTROL_POINT_IDX, BLE_SERVS_HDL_VAL_CNF),
  BLE_CSCS_EVENT_SC_CONTROL_POINT_CLI_CNFG_WRITE_REQ = BLE_SERVS_ATTR_EVENT(BLE_CSCS_SC_CONTROL_POINT_CLI_CNFG_IDX, BLE_SERVS_WRITE_REQ),
  BLE_CSCS_EVENT_SC_CONTROL_POINT_CLI_CNFG_WRITE_COMP = BLE_SERVS_ATTR_EVENT(BLE_CSCS_SC_CONTROL_POINT_CLI_CNFG_IDX, BLE_SERVS_WRITE_COMP),
  BLE_CSCS_EVENT_SC_CONTROL_POINT_CLI_CNFG_READ_REQ = BLE_SERVS_ATTR_EVENT(BLE_CSCS_SC_CONTROL_POINT_CLI_CNFG_IDX, BLE_SERVS_READ_REQ)
}
 Cycling Speed and Cadence Service event type. More...
 

Functions

ble_status_t R_BLE_CSCS_Notifycscmeas (uint16_t conn_hdl, const st_ble_cscs_csc_measurement_t *p_value)
 Send notificatoin of CSC Measurement characteristic value to the remote device. More...
 
ble_status_t R_BLE_CSCS_Setcsc_Measclicnfg (uint16_t conn_hdl, const uint16_t *p_value)
 Set CSC Measurement cli cnfg descriptor value to the local GATT database. More...
 
ble_status_t R_BLE_CSCS_Getcsc_Measclicnfg (uint16_t conn_hdl, uint16_t *p_value)
 Get CSC Measurement cli cnfg descriptor value from the local GATT database. More...
 
ble_status_t R_BLE_CSCS_Setfeat (const st_ble_cscs_csc_feature_t *p_value)
 Set CSC Feature characteristic value to the local GATT database. More...
 
ble_status_t R_BLE_CSCS_Getfeat (st_ble_cscs_csc_feature_t *p_value)
 Get CSC Feature characteristic value from the local GATT database. More...
 
ble_status_t R_BLE_CSCS_Set_Sensor_loc (const uint8_t *p_value)
 Set Sensor Location characteristic value to the local GATT database. More...
 
ble_status_t R_BLE_CSCS_Get_Sensor_loc (uint8_t *p_value)
 Get Sensor Location characteristic value from the local GATT database. More...
 
ble_status_t R_BLE_CSCS_IndicateSc_cp (uint16_t conn_hdl, const st_ble_cscs_sc_cp_t *p_value)
 Send indication of SC Control Point characteristic value to the remote device. More...
 
ble_status_t R_BLE_CSCS_SetSc_cp_CliCnfg (uint16_t conn_hdl, const uint16_t *p_value)
 Set SC Control Point cli cnfg descriptor value to the local GATT database. More...
 
ble_status_t R_BLE_CSCS_GetSc_cp_CliCnfg (uint16_t conn_hdl, uint16_t *p_value)
 Get SC Control Point cli cnfg descriptor value from the local GATT database. More...
 
ble_status_t R_BLE_CSCS_Init (ble_servs_app_cb_t cb)
 Initialize Cycling Speed and Cadence Service service. More...
 

Macro Definition Documentation

◆ BLE_CSCS_PRV_WRITE_REQUEST_REJECTED

#define BLE_CSCS_PRV_WRITE_REQUEST_REJECTED   (BLE_ERR_GROUP_GATT | 0x82)

Write Request Rejected error code.

◆ BLE_CSCS_PRV_SC_CONTROL_POINT_RESPONSE_PARAMETER_LEN

#define BLE_CSCS_PRV_SC_CONTROL_POINT_RESPONSE_PARAMETER_LEN   (17)

Response Parameter length .

◆ BLE_CSCS_PRV_MAX_SENSOR_LOCATIONS_SUPPORTED

#define BLE_CSCS_PRV_MAX_SENSOR_LOCATIONS_SUPPORTED   (17)

Max No of Supported Sensor Locations.

◆ BLE_CSCS_PROCEDURE_ALREADY_IN_PROGRESS_ERROR

#define BLE_CSCS_PROCEDURE_ALREADY_IN_PROGRESS_ERROR   (BLE_ERR_GROUP_GATT | 0x80)

Procedure Already in Progress error code.

◆ BLE_CSCS_CLI_CNFG_IMPROPERLY_CONFIGURED_ERROR

#define BLE_CSCS_CLI_CNFG_IMPROPERLY_CONFIGURED_ERROR   (BLE_ERR_GROUP_GATT | 0x81)

Client Characteristic Configuration descriptor improperly configured error code.

Enumeration Type Documentation

◆ e_ble_sensor_location_t

Sensor Location Sensor Location enumeration.

Enumerator
BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION_OTHER 

Other

BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION_TOP_OF_SHOE 

Top of shoe

BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION_IN_SHOE 

In shoe

BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION_HIP 

Hip

BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION__FRONT_WHEEL 

Front Wheel

BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION_LEFT_CRANK 

Left Crank

BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION_RIGHT_CRANK 

Right Crank

BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION_LEFT_PEDAL 

Left Pedal

BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION_RIGHT_PEDAL 

Right Pedal

BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION__FRONT_HUB 

Front Hub

BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION_REAR_DROPOUT 

Rear Dropout

BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION_CHAINSTAY 

Chainstay

BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION_REAR_WHEEL 

Rear Wheel

BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION_REAR_HUB 

Rear Hub

BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION_CHEST 

Chest

BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION_SPIDER 

Spider

BLE_CSCS_SENSOR_LOCATION_SENSOR_LOCATION_CHAIN_RING 

Chain Ring

◆ e_ble_cscs_sc_cp_op_code_t

SC Control Point Op Code enumeration.

Enumerator
BLE_CSCS_SC_CONTROL_POINT_OP_CODE_RESERVED_FOR_FUTURE_USE 

Reserved for future use

BLE_CSCS_SC_CONTROL_POINT_OP_CODE_SET_CUMULATIVE_VALUE 

Set Cumulative Value

BLE_CSCS_SC_CONTROL_POINT_OP_CODE_START_SENSOR_CALIBRATION 

Start Sensor Calibration

BLE_CSCS_SC_CONTROL_POINT_OP_CODE_UPDATE_SENSOR_LOCATION 

Update Sensor Location

BLE_CSCS_SC_CONTROL_POINT_OP_CODE_REQUEST_SUPPORTED_SENSOR_LOCATIONS 

Request Supported Sensor Locations

BLE_CSCS_SC_CONTROL_POINT_OP_CODE_RESPONSE_CODE 

Response Code

◆ e_ble_cscs_sc_cp_response_value_t

SC Control Point Response Value enumeration.

Enumerator
BLE_CSCS_SC_CONTROL_POINT_RESPONSE_VALUE_RESERVED_FOR_FUTURE_USE__RESPONSE_PARAMETER__N_A_ 

RFU (Response Parameter: N/A)

BLE_CSCS_SC_CONTROL_POINT_RESPONSE_VALUE_SUCCESS__RESPONSE_PARAMETER__NONE_EXCEPT_FOR_OP_CODE_0X04_SEE_NOTE_BELOW_ 

Success

BLE_CSCS_SC_CONTROL_POINT_RESPONSE_VALUE_OP_CODE_NOT_SUPPORTED__RESPONSE_PARAMETER__N_A_ 

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

BLE_CSCS_SC_CONTROL_POINT_RESPONSE_VALUE_INVALID_PARAMETER__RESPONSE_PARAMETER__NONE_ 

Invalid Parameter (Response Parameter: None)

BLE_CSCS_SC_CONTROL_POINT_RESPONSE_VALUE_OPERATION_FAILED__RESPONSE_PARAMETER__NONE_ 

Operation Failed (Response Parameter: None)

◆ e_ble_cscs_char_idx_t

Cycling Speed and Cadence Service characteristic Index.

◆ e_ble_cscs_event_t

Cycling Speed and Cadence Service event type.

Function Documentation

◆ R_BLE_CSCS_Notifycscmeas()

ble_status_t R_BLE_CSCS_Notifycscmeas ( uint16_t  conn_hdl,
const st_ble_cscs_csc_measurement_t p_value 
)

Send notificatoin of CSC Measurement characteristic value to the remote device.

Parameters
[in]conn_hdlConnection handle.
[in]p_valueCharacteristic value to send.
Returns
ble_status_t

◆ R_BLE_CSCS_Setcsc_Measclicnfg()

ble_status_t R_BLE_CSCS_Setcsc_Measclicnfg ( uint16_t  conn_hdl,
const uint16_t *  p_value 
)

Set CSC Measurement cli cnfg descriptor value to the local GATT database.

Parameters
[in]conn_hdlConnection handle.
[in]p_valueDescriptor value to set.
Returns
ble_status_t

◆ R_BLE_CSCS_Getcsc_Measclicnfg()

ble_status_t R_BLE_CSCS_Getcsc_Measclicnfg ( uint16_t  conn_hdl,
uint16_t *  p_value 
)

Get CSC Measurement cli cnfg descriptor value from the local GATT database.

Parameters
[in]conn_hdlConnection handle.
[out]p_valueOutput location for the acquired descriptor value.
Returns
ble_status_t

◆ R_BLE_CSCS_Setfeat()

ble_status_t R_BLE_CSCS_Setfeat ( const st_ble_cscs_csc_feature_t p_value)

Set CSC Feature characteristic value to the local GATT database.

Parameters
[in]p_valueCharacteristic value to set.
Returns
ble_status_t

◆ R_BLE_CSCS_Getfeat()

ble_status_t R_BLE_CSCS_Getfeat ( st_ble_cscs_csc_feature_t p_value)

Get CSC Feature characteristic value from the local GATT database.

Parameters
[out]p_valueOutput location for the acquired descriptor value.
Returns
ble_status_t

◆ R_BLE_CSCS_Set_Sensor_loc()

ble_status_t R_BLE_CSCS_Set_Sensor_loc ( const uint8_t *  p_value)

Set Sensor Location characteristic value to the local GATT database.

Parameters
[in]p_valueCharacteristic value to set.
Returns
ble_status_t

◆ R_BLE_CSCS_Get_Sensor_loc()

ble_status_t R_BLE_CSCS_Get_Sensor_loc ( uint8_t *  p_value)

Get Sensor Location characteristic value from the local GATT database.

Parameters
[out]p_valueOutput location for the acquired descriptor value.
Returns
ble_status_t

◆ R_BLE_CSCS_IndicateSc_cp()

ble_status_t R_BLE_CSCS_IndicateSc_cp ( uint16_t  conn_hdl,
const st_ble_cscs_sc_cp_t p_value 
)

Send indication of SC Control Point characteristic value to the remote device.

Parameters
[in]conn_hdlConnection handle.
[in]p_valueCharacteristic value to send.
Returns
ble_status_t

◆ R_BLE_CSCS_SetSc_cp_CliCnfg()

ble_status_t R_BLE_CSCS_SetSc_cp_CliCnfg ( uint16_t  conn_hdl,
const uint16_t *  p_value 
)

Set SC Control Point cli cnfg descriptor value to the local GATT database.

Parameters
[in]conn_hdlConnection handle.
[in]p_valueDescriptor value to set.
Returns
ble_status_t

◆ R_BLE_CSCS_GetSc_cp_CliCnfg()

ble_status_t R_BLE_CSCS_GetSc_cp_CliCnfg ( uint16_t  conn_hdl,
uint16_t *  p_value 
)

Get SC Control Point cli cnfg descriptor value from the local GATT database.

Parameters
[in]conn_hdlConnection handle.
[out]p_valueOutput location for the acquired descriptor value.
Returns
ble_status_t

◆ R_BLE_CSCS_Init()

ble_status_t R_BLE_CSCS_Init ( ble_servs_app_cb_t  cb)

Initialize Cycling Speed and Cadence Service service.

Parameters
[in]cbService callback.
Returns
ble_status_t