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

This is the client for the Cycling Power Service. More...

Detailed Description

This is the client for the Cycling Power Service.

Data Structures

struct  st_ble_cpc_meas_flags_t
 Cycling Power Measurement Flags value structure. More...
 
struct  st_ble_cpc_meas_t
 Cycling Power Measurement value structure. More...
 
struct  st_ble_cpc_meas_attr_hdl_t
 Cycling Power Measurement attribute handle value. More...
 
struct  st_ble_cpc_feat_t
 Cycling Power Feature value structure. More...
 
struct  st_ble_cpc_feat_attr_hdl_t
 Cycling Power Feature attribute handle value. More...
 
struct  st_ble_cpc_sensor_loc_attr_hdl_t
 Sensor Location attribute handle value. More...
 
struct  st_ble_vector_flags_t
 Cycling Power Vector Flags value structure. More...
 
struct  st_ble_cpc_vector_t
 Cycling Power Vector value structure. More...
 
struct  st_ble_cpc_vector_attr_hdl_t
 Cycling Power Vector attribute handle value. More...
 
struct  st_start_enhanced_offset_compensation_respnse_t
 Cycling Power Control Point Response parameters. More...
 
union  u_cpc_cp_control_point_response_parameter_t
 
union  u_cpc_cp_control_point_request_parameter_t
 Cycling Power Control Point Request . More...
 
struct  st_ble_cpc_cp_t
 Cycling Power Control Point value structure. More...
 
struct  st_ble_cpc_cp_attr_hdl_t
 Cycling Power Control Point attribute handle value. More...
 
struct  st_ble_cpc_evt_data_t
 Cycling Power client event data. More...
 

Macros

#define NUM_OF_SUPPORTED_SENSOR_LOCATIONS   (17)
 Number of sensor locations. More...
 
#define BLE_CPC_MEAS_UUID   (0x2A63)
 
#define BLE_CPC_MEAS_LEN   (34)
 
#define BLE_CPC_MEAS_CLI_CNFG_UUID   (0x2902)
 
#define BLE_CPC_MEAS_CLI_CNFG_LEN   (2)
 
#define BLE_CPC_MEAS_SER_CNFG_UUID   (0x2903)
 
#define BLE_CPC_MEAS_SER_CNFG_LEN   (2)
 
#define BLE_PRV_CPC_CP_MESURMNT_FLAGS_PEDAL_POWER_BALANCE_PRSNT   (1 << 0)
 Pedal Power Balance Present bit. More...
 
#define BLE_PRV_CPC_CP_MESURMNT_FLAGS_PEDAL_POWER_BALANCE_REFERENCE   (1 << 1)
 Pedal Power Balance Reference bit. More...
 
#define BLE_PRV_CPC_CP_MESURMNT_FLAGS_ACCUMULATED_TORQUE_PRSNT   (1 << 2)
 Accumulated Torque Present bit. More...
 
#define BLE_PRV_CPC_CP_MESURMNT_FLAGS_ACCUMULATED_TORQUE_SOURCE   (1 << 3)
 Accumulated Torque Source bit. More...
 
#define BLE_PRV_CPC_CP_MESURMNT_FLAGS_WHEEL_REVOLUTION_DATA_PRSNT   (1 << 4)
 Wheel Revolution Data Present bit. More...
 
#define BLE_PRV_CPC_CP_MESURMNT_FLAGS_CRANK_REVOLUTION_DATA_PRSNT   (1 << 5)
 Crank Revolution Data Present bit. More...
 
#define BLE_PRV_CPC_CP_MESURMNT_FLAGS_EXTREME_FORCE_MAGNITUDES_PRSNT   (1 << 6)
 Extreme Force Magnitudes Present bit. More...
 
#define BLE_PRV_CPC_CP_MESURMNT_FLAGS_EXTREME_TORQUE_MAGNITUDES_PRSNT   (1 << 7)
 Extreme Torque Magnitudes Present bit. More...
 
#define BLE_PRV_CPC_CP_MESURMNT_FLAGS_EXTREME_ANGLES_PRSNT   (1 << 8)
 Extreme Angles Present bit. More...
 
#define BLE_PRV_CPC_CP_MESURMNT_FLAGS_TOP_DEAD_SPOT_ANGLE_PRSNT   (1 << 9)
 Top Dead Spot Angle Present bit. More...
 
#define BLE_PRV_CPC_CP_MESURMNT_FLAGS_BOTTOM_DEAD_SPOT_ANGLE_PRSNT   (1 << 10)
 Bottom Dead Spot Angle Present bit. More...
 
#define BLE_PRV_CPC_CP_MESURMNT_FLAGS_ACCUMULATED_ENERGY_PRSNT   (1 << 11)
 Accumulated Energy Present bit. More...
 
#define BLE_PRV_CPC_CP_MESURMNT_FLAGS_OFFSET_COMPENSATION_INDICATOR   (1 << 12)
 Offset Compensation Indicator bit. More...
 
#define BLE_CPC_FEAT_UUID   (0x2A65)
 
#define BLE_CPC_FEAT_LEN   (4)
 
#define BLE_CPC_SENSOR_LOC_UUID   (0x2A5D)
 
#define BLE_CPC_SENSOR_LOC_LEN   (1)
 
#define BLE_CPC_VECTOR_UUID   (0x2A64)
 
#define BLE_CPC_VECTOR_LEN   (11)
 
#define BLE_CPC_VECTOR_CLI_CNFG_UUID   (0x2902)
 
#define BLE_CPC_VECTOR_CLI_CNFG_LEN   (2)
 
#define BLE_PRV_CPC_CPV_FLAGS_CRANK_REVLUTN_DATA_PRSNT   (1 << 0)
 Crank Revolution Data Present bit. More...
 
#define BLE_PRV_CPC_CPV_FLAGS_FIRST_CRANK_MESURMNT_ANGLE_PRSNT   (1 << 1)
 First Crank Measurement Angle Present bit. More...
 
#define BLE_PRV_CPC_CPV_FLAGS_INSTANT_FORCE_MAGNITUDE_ARR_PRSNT   (1 << 2)
 Instantaneous Force Magnitude Array Present bit. More...
 
#define BLE_PRV_CPC_CPV_FLAGS_INSTANT_TORQUE_MAGNITUDE_ARR_PRSNT   (1 << 3)
 Instantaneous Torque Magnitude Array Present bit. More...
 
#define BLE_PRV_CPC_CPV_FLAGS_INSTANT_MESURENT_DIRECTN   (((1 << 2) - 1) << 4)
 Instantaneous Measurement Direction bits. More...
 
#define BLE_CPC_CYCLING_POWER_CONTROL_POINT_OP_CODES_RESPONSE_CODE   (32)
 Response code to be sent to every response for control point request. More...
 
#define BLE_CPC_CP_UUID   (0x2A66)
 
#define BLE_CPC_CP_LEN   (20)
 
#define BLE_CPC_CP_CLI_CNFG_UUID   (0x2902)
 
#define BLE_CPC_CP_CLI_CNFG_LEN   (2)
 
#define BLE_CPC_INAPPOPROPRIATE_CONNECTION_PARAMETERS_ERROR   (BLE_ERR_GROUP_GATT | 0x80)
 Inappopropriate Connection Parameters. More...
 

Enumerations

enum  e_ble_sensor_loc_sensor_location_t {
  BLE_CPC_SENSOR_LOC_SENSOR_LOCATION_OTHER = 0,
  BLE_CPC_SENSOR_LOC_SENSOR_LOCATION_TOP_OF_SHOE = 1,
  BLE_CPC_SENSOR_LOC_SENSOR_LOCATION_IN_SHOE = 2,
  BLE_CPC_SENSOR_LOC_SENSOR_LOCATION_HIP = 3,
  BLE_CPC_SENSOR_LOC_SENSOR_LOCATION__FRONT_WHEEL = 4,
  BLE_CPC_SENSOR_LOC_SENSOR_LOCATION_LEFT_CRANK = 5,
  BLE_CPC_SENSOR_LOC_SENSOR_LOCATION_RIGHT_CRANK = 6,
  BLE_CPC_SENSOR_LOC_SENSOR_LOCATION_LEFT_PEDAL = 7,
  BLE_CPC_SENSOR_LOC_SENSOR_LOCATION_RIGHT_PEDAL = 8,
  BLE_CPC_SENSOR_LOC_SENSOR_LOCATION__FRONT_HUB = 9,
  BLE_CPC_SENSOR_LOC_SENSOR_LOCATION_REAR_DROPOUT = 10,
  BLE_CPC_SENSOR_LOC_SENSOR_LOCATION_CHAINSTAY = 11,
  BLE_CPC_SENSOR_LOC_SENSOR_LOCATION_REAR_WHEEL = 12,
  BLE_CPC_SENSOR_LOC_SENSOR_LOCATION_REAR_HUB = 13,
  BLE_CPC_SENSOR_LOC_SENSOR_LOCATION_CHEST = 14,
  BLE_CPC_SENSOR_LOC_SENSOR_LOCATION_SPIDER = 15,
  BLE_CPC_SENSOR_LOC_SENSOR_LOCATION_CHAIN_RING = 16
}
 Sensor Location Sensor Location enumeration. More...
 
enum  e_ble_cp_op_codes_t {
  BLE_CPC_CP_OP_CODES_SET_CUMULATIVE_VALUE = 1,
  BLE_CPC_CP_OP_CODES_UPDATE_SENSOR_LOCATION = 2,
  BLE_CPC_CP_OP_CODES_REQUEST_SUPPORTED_SENSOR_LOCATIONS = 3,
  BLE_CPC_CP_OP_CODES_SET_CRANK_LENGTH = 4,
  BLE_CPC_CP_OP_CODES_REQUEST_CRANK_LENGTH = 5,
  BLE_CPC_CP_OP_CODES_SET_CHAIN_LENGTH = 6,
  BLE_CPC_CP_OP_CODES_REQUEST_CHAIN_LENGTH = 7,
  BLE_CPC_CP_OP_CODES_SET_CHAIN_WEIGHT = 8,
  BLE_CPC_CP_OP_CODES_REQUEST_CHAIN_WEIGHT = 9,
  BLE_CPC_CP_OP_CODES_SET_SPAN_LENGTH = 10,
  BLE_CPC_CP_OP_CODES_REQUEST_SPAN_LENGTH = 11,
  BLE_CPC_CP_OP_CODES_START_OFFSET_COMPENSATION = 12,
  BLE_CPC_CP_OP_CODES_MASK_CYCLING_POWER_MEASUREMENT_CHARACTERISTIC_CONTENT = 13,
  BLE_CPC_CP_OP_CODES_REQUEST_SAMPLING_RATE = 14,
  BLE_CPC_CP_OP_CODES_REQUEST_FACTORY_CALIBRATION_DATE = 15,
  BLE_CPC_CP_OP_CODES_START_ENHANCED_OFFSET_COMPENSATION = 16,
  BLE_CPC_CP_OP_CODES_RESPONSE_CODE = 32
}
 Cycling Power Control Point Op Codes enumeration. More...
 
enum  e_ble_cp_response_value_t {
  BLE_CPC_CP_RESPONSE_VALUE_SUCCESS = 1,
  BLE_CPC_CP_RESPONSE_VALUE_OP_CODE_NOT_SUPPORTED = 2,
  BLE_CPC_CP_RESPONSE_VALUE_INVALID_PARAMETER = 3,
  BLE_CPC_CP_RESPONSE_VALUE_OPERATION_FAILED = 4
}
 Cycling Power Control Point Response Value enumeration. More...
 
enum  e_ble_cpc_char_idx_t {
  BLE_CPC_MEAS_IDX,
  BLE_CPC_MEAS_CLI_CNFG_IDX,
  BLE_CPC_MEAS_SER_CNFG_IDX,
  BLE_CPC_FEAT_IDX,
  BLE_CPC_SENSOR_LOC_IDX,
  BLE_CPC_VECTOR_IDX,
  BLE_CPC_VECTOR_CLI_CNFG_IDX,
  BLE_CPC_CP_IDX,
  BLE_CPC_CP_CLI_CNFG_IDX
}
 Cycling Power characteristic ID. More...
 
enum  e_ble_cpc_event_t {
  BLE_CPC_EVENT_MEAS_HDL_VAL_NTF = BLE_SERVC_ATTR_EVENT(BLE_CPC_MEAS_IDX, BLE_SERVC_HDL_VAL_NTF),
  BLE_CPC_EVENT_MEAS_CLI_CNFG_READ_RSP = BLE_SERVC_ATTR_EVENT(BLE_CPC_MEAS_CLI_CNFG_IDX, BLE_SERVC_READ_RSP),
  BLE_CPC_EVENT_MEAS_CLI_CNFG_WRITE_RSP = BLE_SERVC_ATTR_EVENT(BLE_CPC_MEAS_CLI_CNFG_IDX, BLE_SERVC_WRITE_RSP),
  BLE_CPC_EVENT_MEAS_SER_CNFG_READ_RSP = BLE_SERVC_ATTR_EVENT(BLE_CPC_MEAS_SER_CNFG_IDX, BLE_SERVC_READ_RSP),
  BLE_CPC_EVENT_MEAS_SER_CNFG_WRITE_RSP = BLE_SERVC_ATTR_EVENT(BLE_CPC_MEAS_SER_CNFG_IDX, BLE_SERVC_WRITE_RSP),
  BLE_CPC_EVENT_FEAT_READ_RSP = BLE_SERVC_ATTR_EVENT(BLE_CPC_FEAT_IDX, BLE_SERVC_READ_RSP),
  BLE_CPC_EVENT_SENSOR_LOC_READ_RSP = BLE_SERVC_ATTR_EVENT(BLE_CPC_SENSOR_LOC_IDX, BLE_SERVC_READ_RSP),
  BLE_CPC_EVENT_VECTOR_HDL_VAL_NTF = BLE_SERVC_ATTR_EVENT(BLE_CPC_VECTOR_IDX, BLE_SERVC_HDL_VAL_NTF),
  BLE_CPC_EVENT_VECTOR_CLI_CNFG_READ_RSP = BLE_SERVC_ATTR_EVENT(BLE_CPC_VECTOR_CLI_CNFG_IDX, BLE_SERVC_READ_RSP),
  BLE_CPC_EVENT_VECTOR_CLI_CNFG_WRITE_RSP = BLE_SERVC_ATTR_EVENT(BLE_CPC_VECTOR_CLI_CNFG_IDX, BLE_SERVC_WRITE_RSP),
  BLE_CPC_EVENT_CP_WRITE_RSP = BLE_SERVC_ATTR_EVENT(BLE_CPC_CP_IDX, BLE_SERVC_WRITE_RSP),
  BLE_CPC_EVENT_CP_HDL_VAL_IND = BLE_SERVC_ATTR_EVENT(BLE_CPC_CP_IDX, BLE_SERVC_HDL_VAL_IND),
  BLE_CPC_EVENT_CP_CLI_CNFG_READ_RSP = BLE_SERVC_ATTR_EVENT(BLE_CPC_CP_CLI_CNFG_IDX, BLE_SERVC_READ_RSP),
  BLE_CPC_EVENT_CP_CLI_CNFG_WRITE_RSP = BLE_SERVC_ATTR_EVENT(BLE_CPC_CP_CLI_CNFG_IDX, BLE_SERVC_WRITE_RSP)
}
 Cycling Power client event type. More...
 

Functions

ble_status_t R_BLE_CPC_ReadMeasCliCnfg (uint16_t conn_hdl)
 Read Cycling Power Measurement characteristic Client Characteristic Configuration descriptor value from the remote GATT database. More...
 
ble_status_t R_BLE_CPC_WriteMeasCliCnfg (uint16_t conn_hdl, const uint16_t *p_value)
 Write Cycling Power Measurement characteristic Client Characteristic Configuration descriptor value to remote GATT database. More...
 
ble_status_t R_BLE_CPC_ReadMeasSerCnfg (uint16_t conn_hdl)
 Read Cycling Power Measurement characteristic Server Characteristic Configuration descriptor value from the remote GATT database. More...
 
ble_status_t R_BLE_CPC_WriteMeasSerCnfg (uint16_t conn_hdl, const uint16_t *p_value)
 Write Cycling Power Measurement characteristic Server Characteristic Configuration descriptor value to remote GATT database. More...
 
void R_BLE_CPC_GetMeasAttrHdl (const st_ble_dev_addr_t *p_addr, st_ble_cpc_meas_attr_hdl_t *p_hdl)
 Get Cycling Power Measurement attribute handles. More...
 
ble_status_t R_BLE_CPC_ReadFeat (uint16_t conn_hdl)
 Read Cycling Power Feature characteristic value from the remote GATT database. More...
 
void R_BLE_CPC_GetFeatAttrHdl (const st_ble_dev_addr_t *p_addr, st_ble_cpc_feat_attr_hdl_t *p_hdl)
 Get Cycling Power Feature attribute handles. More...
 
ble_status_t R_BLE_CPC_ReadSensorLoc (uint16_t conn_hdl)
 Read Sensor Location characteristic value from the remote GATT database. More...
 
void R_BLE_CPC_GetSensorLocAttrHdl (const st_ble_dev_addr_t *p_addr, st_ble_cpc_sensor_loc_attr_hdl_t *p_hdl)
 Get Sensor Location attribute handles. More...
 
ble_status_t R_BLE_CPC_ReadVectorCliCnfg (uint16_t conn_hdl)
 Read Cycling Power Vector characteristic Client Characteristic Configuration descriptor value from the remote GATT database. More...
 
ble_status_t R_BLE_CPC_WriteVectorCliCnfg (uint16_t conn_hdl, const uint16_t *p_value)
 Write Cycling Power Vector characteristic Client Characteristic Configuration descriptor value to remote GATT database. More...
 
void R_BLE_CPC_GetVectorAttrHdl (const st_ble_dev_addr_t *p_addr, st_ble_cpc_vector_attr_hdl_t *p_hdl)
 Get Cycling Power Vector attribute handles. More...
 
ble_status_t R_BLE_CPC_ReadCpCliCnfg (uint16_t conn_hdl)
 Read Cycling Power Control Point characteristic Client Characteristic Configuration descriptor value from the remote GATT database. More...
 
ble_status_t R_BLE_CPC_WriteCpCliCnfg (uint16_t conn_hdl, const uint16_t *p_value)
 Write Cycling Power Control Point characteristic Client Characteristic Configuration descriptor value to remote GATT database. More...
 
ble_status_t R_BLE_CPC_WriteCp (uint16_t conn_hdl, const st_ble_cpc_cp_t *p_value)
 Write Cycling Power Control Point characteristic value to remote GATT database. More...
 
void R_BLE_CPC_GetCpAttrHdl (const st_ble_dev_addr_t *p_addr, st_ble_cpc_cp_attr_hdl_t *p_hdl)
 Get Cycling Power Control Point attribute handles. More...
 
ble_status_t R_BLE_CPC_Init (ble_servc_app_cb_t cb)
 Initialize Cycling Power client. More...
 
void R_BLE_CPC_ServDiscCb (uint16_t conn_hdl, uint8_t serv_idx, uint16_t type, void *p_param)
 Cycling Power client discovery callback. More...
 
void R_BLE_CPC_GetServAttrHdl (const st_ble_dev_addr_t *p_addr, st_ble_gatt_hdl_range_t *p_hdl)
 Get Cycling Power client attribute handle. More...
 

Macro Definition Documentation

◆ NUM_OF_SUPPORTED_SENSOR_LOCATIONS

#define NUM_OF_SUPPORTED_SENSOR_LOCATIONS   (17)

Number of sensor locations.

◆ BLE_PRV_CPC_CP_MESURMNT_FLAGS_PEDAL_POWER_BALANCE_PRSNT

#define BLE_PRV_CPC_CP_MESURMNT_FLAGS_PEDAL_POWER_BALANCE_PRSNT   (1 << 0)

Pedal Power Balance Present bit.

◆ BLE_PRV_CPC_CP_MESURMNT_FLAGS_PEDAL_POWER_BALANCE_REFERENCE

#define BLE_PRV_CPC_CP_MESURMNT_FLAGS_PEDAL_POWER_BALANCE_REFERENCE   (1 << 1)

Pedal Power Balance Reference bit.

◆ BLE_PRV_CPC_CP_MESURMNT_FLAGS_ACCUMULATED_TORQUE_PRSNT

#define BLE_PRV_CPC_CP_MESURMNT_FLAGS_ACCUMULATED_TORQUE_PRSNT   (1 << 2)

Accumulated Torque Present bit.

◆ BLE_PRV_CPC_CP_MESURMNT_FLAGS_ACCUMULATED_TORQUE_SOURCE

#define BLE_PRV_CPC_CP_MESURMNT_FLAGS_ACCUMULATED_TORQUE_SOURCE   (1 << 3)

Accumulated Torque Source bit.

◆ BLE_PRV_CPC_CP_MESURMNT_FLAGS_WHEEL_REVOLUTION_DATA_PRSNT

#define BLE_PRV_CPC_CP_MESURMNT_FLAGS_WHEEL_REVOLUTION_DATA_PRSNT   (1 << 4)

Wheel Revolution Data Present bit.

◆ BLE_PRV_CPC_CP_MESURMNT_FLAGS_CRANK_REVOLUTION_DATA_PRSNT

#define BLE_PRV_CPC_CP_MESURMNT_FLAGS_CRANK_REVOLUTION_DATA_PRSNT   (1 << 5)

Crank Revolution Data Present bit.

◆ BLE_PRV_CPC_CP_MESURMNT_FLAGS_EXTREME_FORCE_MAGNITUDES_PRSNT

#define BLE_PRV_CPC_CP_MESURMNT_FLAGS_EXTREME_FORCE_MAGNITUDES_PRSNT   (1 << 6)

Extreme Force Magnitudes Present bit.

◆ BLE_PRV_CPC_CP_MESURMNT_FLAGS_EXTREME_TORQUE_MAGNITUDES_PRSNT

#define BLE_PRV_CPC_CP_MESURMNT_FLAGS_EXTREME_TORQUE_MAGNITUDES_PRSNT   (1 << 7)

Extreme Torque Magnitudes Present bit.

◆ BLE_PRV_CPC_CP_MESURMNT_FLAGS_EXTREME_ANGLES_PRSNT

#define BLE_PRV_CPC_CP_MESURMNT_FLAGS_EXTREME_ANGLES_PRSNT   (1 << 8)

Extreme Angles Present bit.

◆ BLE_PRV_CPC_CP_MESURMNT_FLAGS_TOP_DEAD_SPOT_ANGLE_PRSNT

#define BLE_PRV_CPC_CP_MESURMNT_FLAGS_TOP_DEAD_SPOT_ANGLE_PRSNT   (1 << 9)

Top Dead Spot Angle Present bit.

◆ BLE_PRV_CPC_CP_MESURMNT_FLAGS_BOTTOM_DEAD_SPOT_ANGLE_PRSNT

#define BLE_PRV_CPC_CP_MESURMNT_FLAGS_BOTTOM_DEAD_SPOT_ANGLE_PRSNT   (1 << 10)

Bottom Dead Spot Angle Present bit.

◆ BLE_PRV_CPC_CP_MESURMNT_FLAGS_ACCUMULATED_ENERGY_PRSNT

#define BLE_PRV_CPC_CP_MESURMNT_FLAGS_ACCUMULATED_ENERGY_PRSNT   (1 << 11)

Accumulated Energy Present bit.

◆ BLE_PRV_CPC_CP_MESURMNT_FLAGS_OFFSET_COMPENSATION_INDICATOR

#define BLE_PRV_CPC_CP_MESURMNT_FLAGS_OFFSET_COMPENSATION_INDICATOR   (1 << 12)

Offset Compensation Indicator bit.

◆ BLE_PRV_CPC_CPV_FLAGS_CRANK_REVLUTN_DATA_PRSNT

#define BLE_PRV_CPC_CPV_FLAGS_CRANK_REVLUTN_DATA_PRSNT   (1 << 0)

Crank Revolution Data Present bit.

◆ BLE_PRV_CPC_CPV_FLAGS_FIRST_CRANK_MESURMNT_ANGLE_PRSNT

#define BLE_PRV_CPC_CPV_FLAGS_FIRST_CRANK_MESURMNT_ANGLE_PRSNT   (1 << 1)

First Crank Measurement Angle Present bit.

◆ BLE_PRV_CPC_CPV_FLAGS_INSTANT_FORCE_MAGNITUDE_ARR_PRSNT

#define BLE_PRV_CPC_CPV_FLAGS_INSTANT_FORCE_MAGNITUDE_ARR_PRSNT   (1 << 2)

Instantaneous Force Magnitude Array Present bit.

◆ BLE_PRV_CPC_CPV_FLAGS_INSTANT_TORQUE_MAGNITUDE_ARR_PRSNT

#define BLE_PRV_CPC_CPV_FLAGS_INSTANT_TORQUE_MAGNITUDE_ARR_PRSNT   (1 << 3)

Instantaneous Torque Magnitude Array Present bit.

◆ BLE_PRV_CPC_CPV_FLAGS_INSTANT_MESURENT_DIRECTN

#define BLE_PRV_CPC_CPV_FLAGS_INSTANT_MESURENT_DIRECTN   (((1 << 2) - 1) << 4)

Instantaneous Measurement Direction bits.

◆ BLE_CPC_CYCLING_POWER_CONTROL_POINT_OP_CODES_RESPONSE_CODE

#define BLE_CPC_CYCLING_POWER_CONTROL_POINT_OP_CODES_RESPONSE_CODE   (32)

Response code to be sent to every response for control point request.

◆ BLE_CPC_INAPPOPROPRIATE_CONNECTION_PARAMETERS_ERROR

#define BLE_CPC_INAPPOPROPRIATE_CONNECTION_PARAMETERS_ERROR   (BLE_ERR_GROUP_GATT | 0x80)

Inappopropriate Connection Parameters.

Enumeration Type Documentation

◆ e_ble_sensor_loc_sensor_location_t

Sensor Location Sensor Location enumeration.

Enumerator
BLE_CPC_SENSOR_LOC_SENSOR_LOCATION_OTHER 

Other

BLE_CPC_SENSOR_LOC_SENSOR_LOCATION_TOP_OF_SHOE 

Top of shoe

BLE_CPC_SENSOR_LOC_SENSOR_LOCATION_IN_SHOE 

In shoe

BLE_CPC_SENSOR_LOC_SENSOR_LOCATION_HIP 

Hip

BLE_CPC_SENSOR_LOC_SENSOR_LOCATION__FRONT_WHEEL 

Front Wheel

BLE_CPC_SENSOR_LOC_SENSOR_LOCATION_LEFT_CRANK 

Left Crank

BLE_CPC_SENSOR_LOC_SENSOR_LOCATION_RIGHT_CRANK 

Right Crank

BLE_CPC_SENSOR_LOC_SENSOR_LOCATION_LEFT_PEDAL 

Left Pedal

BLE_CPC_SENSOR_LOC_SENSOR_LOCATION_RIGHT_PEDAL 

Right Pedal

BLE_CPC_SENSOR_LOC_SENSOR_LOCATION__FRONT_HUB 

Front Hub

BLE_CPC_SENSOR_LOC_SENSOR_LOCATION_REAR_DROPOUT 

Rear Dropout

BLE_CPC_SENSOR_LOC_SENSOR_LOCATION_CHAINSTAY 

Chainstay

BLE_CPC_SENSOR_LOC_SENSOR_LOCATION_REAR_WHEEL 

Rear Wheel

BLE_CPC_SENSOR_LOC_SENSOR_LOCATION_REAR_HUB 

Rear Hub

BLE_CPC_SENSOR_LOC_SENSOR_LOCATION_CHEST 

Chest

BLE_CPC_SENSOR_LOC_SENSOR_LOCATION_SPIDER 

Spider

BLE_CPC_SENSOR_LOC_SENSOR_LOCATION_CHAIN_RING 

Chain Ring

◆ e_ble_cp_op_codes_t

Cycling Power Control Point Op Codes enumeration.

Enumerator
BLE_CPC_CP_OP_CODES_SET_CUMULATIVE_VALUE 

Set Cumulative Value

BLE_CPC_CP_OP_CODES_UPDATE_SENSOR_LOCATION 

Update Sensor Location

BLE_CPC_CP_OP_CODES_REQUEST_SUPPORTED_SENSOR_LOCATIONS 

Request Supported Sensor Locations

BLE_CPC_CP_OP_CODES_SET_CRANK_LENGTH 

Set Crank Length

BLE_CPC_CP_OP_CODES_REQUEST_CRANK_LENGTH 

Request Crank Length

BLE_CPC_CP_OP_CODES_SET_CHAIN_LENGTH 

Set Chain Length

BLE_CPC_CP_OP_CODES_REQUEST_CHAIN_LENGTH 

Request Chain Length

BLE_CPC_CP_OP_CODES_SET_CHAIN_WEIGHT 

Set Chain Weight

BLE_CPC_CP_OP_CODES_REQUEST_CHAIN_WEIGHT 

Request Chain Weight

BLE_CPC_CP_OP_CODES_SET_SPAN_LENGTH 

Set Span Length

BLE_CPC_CP_OP_CODES_REQUEST_SPAN_LENGTH 

Request Span Length

BLE_CPC_CP_OP_CODES_START_OFFSET_COMPENSATION 

Start Offset Compensation

BLE_CPC_CP_OP_CODES_MASK_CYCLING_POWER_MEASUREMENT_CHARACTERISTIC_CONTENT 

Mask Cycling Power Measurement Characteristic Content

BLE_CPC_CP_OP_CODES_REQUEST_SAMPLING_RATE 

Request Sampling Rate

BLE_CPC_CP_OP_CODES_REQUEST_FACTORY_CALIBRATION_DATE 

Request Factory Calibration Date

BLE_CPC_CP_OP_CODES_START_ENHANCED_OFFSET_COMPENSATION 

Start Enhanced Offset Compensation

BLE_CPC_CP_OP_CODES_RESPONSE_CODE 

Response Code

◆ e_ble_cp_response_value_t

Cycling Power Control Point Response Value enumeration.

Enumerator
BLE_CPC_CP_RESPONSE_VALUE_SUCCESS 

Success

BLE_CPC_CP_RESPONSE_VALUE_OP_CODE_NOT_SUPPORTED 

Op Code not Supported

BLE_CPC_CP_RESPONSE_VALUE_INVALID_PARAMETER 

Invalid Parameter

BLE_CPC_CP_RESPONSE_VALUE_OPERATION_FAILED 

Operation Failed

◆ e_ble_cpc_char_idx_t

Cycling Power characteristic ID.

◆ e_ble_cpc_event_t

Cycling Power client event type.

Function Documentation

◆ R_BLE_CPC_ReadMeasCliCnfg()

ble_status_t R_BLE_CPC_ReadMeasCliCnfg ( uint16_t  conn_hdl)

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

Parameters
[in]conn_hdlConnection handle.
Returns
ble_status_t

◆ R_BLE_CPC_WriteMeasCliCnfg()

ble_status_t R_BLE_CPC_WriteMeasCliCnfg ( uint16_t  conn_hdl,
const uint16_t *  p_value 
)

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

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

◆ R_BLE_CPC_ReadMeasSerCnfg()

ble_status_t R_BLE_CPC_ReadMeasSerCnfg ( uint16_t  conn_hdl)

Read Cycling Power Measurement characteristic Server Characteristic Configuration descriptor value from the remote GATT database.

Parameters
[in]conn_hdlConnection handle.
Returns
ble_status_t

◆ R_BLE_CPC_WriteMeasSerCnfg()

ble_status_t R_BLE_CPC_WriteMeasSerCnfg ( uint16_t  conn_hdl,
const uint16_t *  p_value 
)

Write Cycling Power Measurement characteristic Server Characteristic Configuration descriptor value to remote GATT database.

Parameters
[in]conn_hdlConnection handle.
[in]p_valueCycling Power Measurement characteristic Server Characteristic Configuration descriptor value to write.
Returns
ble_status_t

◆ R_BLE_CPC_GetMeasAttrHdl()

void R_BLE_CPC_GetMeasAttrHdl ( const st_ble_dev_addr_t p_addr,
st_ble_cpc_meas_attr_hdl_t p_hdl 
)

Get Cycling Power 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_CPC_ReadFeat()

ble_status_t R_BLE_CPC_ReadFeat ( uint16_t  conn_hdl)

Read Cycling Power Feature characteristic value from the remote GATT database.

Parameters
[in]conn_hdlConnection handle.
Returns
ble_status_t

◆ R_BLE_CPC_GetFeatAttrHdl()

void R_BLE_CPC_GetFeatAttrHdl ( const st_ble_dev_addr_t p_addr,
st_ble_cpc_feat_attr_hdl_t p_hdl 
)

Get Cycling Power 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_CPC_ReadSensorLoc()

ble_status_t R_BLE_CPC_ReadSensorLoc ( 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_CPC_GetSensorLocAttrHdl()

void R_BLE_CPC_GetSensorLocAttrHdl ( const st_ble_dev_addr_t p_addr,
st_ble_cpc_sensor_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_CPC_ReadVectorCliCnfg()

ble_status_t R_BLE_CPC_ReadVectorCliCnfg ( uint16_t  conn_hdl)

Read Cycling Power Vector characteristic Client Characteristic Configuration descriptor value from the remote GATT database.

Parameters
[in]conn_hdlConnection handle.
Returns
ble_status_t

◆ R_BLE_CPC_WriteVectorCliCnfg()

ble_status_t R_BLE_CPC_WriteVectorCliCnfg ( uint16_t  conn_hdl,
const uint16_t *  p_value 
)

Write Cycling Power Vector characteristic Client Characteristic Configuration descriptor value to remote GATT database.

Parameters
[in]conn_hdlConnection handle.
[in]p_valueCycling Power Vector characteristic Client Characteristic Configuration descriptor value to write.
Returns
ble_status_t

◆ R_BLE_CPC_GetVectorAttrHdl()

void R_BLE_CPC_GetVectorAttrHdl ( const st_ble_dev_addr_t p_addr,
st_ble_cpc_vector_attr_hdl_t p_hdl 
)

Get Cycling Power Vector 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_CPC_ReadCpCliCnfg()

ble_status_t R_BLE_CPC_ReadCpCliCnfg ( uint16_t  conn_hdl)

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

Parameters
[in]conn_hdlConnection handle.
Returns
ble_status_t

◆ R_BLE_CPC_WriteCpCliCnfg()

ble_status_t R_BLE_CPC_WriteCpCliCnfg ( uint16_t  conn_hdl,
const uint16_t *  p_value 
)

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

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

◆ R_BLE_CPC_WriteCp()

ble_status_t R_BLE_CPC_WriteCp ( uint16_t  conn_hdl,
const st_ble_cpc_cp_t p_value 
)

Write Cycling Power Control Point characteristic value to remote GATT database.

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

◆ R_BLE_CPC_GetCpAttrHdl()

void R_BLE_CPC_GetCpAttrHdl ( const st_ble_dev_addr_t p_addr,
st_ble_cpc_cp_attr_hdl_t p_hdl 
)

Get Cycling Power 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_CPC_Init()

ble_status_t R_BLE_CPC_Init ( ble_servc_app_cb_t  cb)

Initialize Cycling Power client.

Parameters
[in]cbClient callback.
Returns
ble_status_t

◆ R_BLE_CPC_ServDiscCb()

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

Cycling Power client discovery callback.

Parameters
[in]conn_hdlConnection handle
[in]serv_idxService instance index.
[in]typeService discovery event type.
[in]p_paramService discovery event parameter.
Returns
ble_status_t

◆ R_BLE_CPC_GetServAttrHdl()

void R_BLE_CPC_GetServAttrHdl ( const st_ble_dev_addr_t p_addr,
st_ble_gatt_hdl_range_t p_hdl 
)

Get Cycling Power client attribute handle.

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