I have developed CyclingPower SIG service based on (a) CSCS example and on (b) old file found here, at Devzone.
It used to work, but then something happened and I can't make it work again. I am attaching *.h and *.c files and below is my init routine:
static void cps_service_init(void){
uint32_t err_code;
ble_cps_init_t cps_init;
memset(&cps_init, 0, sizeof(cps_init));
cps_init.evt_handler = NULL;
cps_init.feature = BLE_CPS_FEATURE_WHEEL_REV_BIT | BLE_CPS_FEATURE_CRANK_REV_BIT |
BLE_CPS_FEATURE_MULTIPLE_SENSORS_BIT;
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&cps_init.cp_meas_attr_md.cccd_write_perm);
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&cps_init.cp_feature_attr_md.read_perm);
cps_init.ctrlpt_evt_handler = sc_ctrlpt_event_handler;
cps_init.list_supported_locations = supported_locations;
cps_init.size_list_supported_locations = sizeof(supported_locations) /
sizeof(ble_sensor_location_t);
sensor_location = BLE_SENSOR_LOCATION_LEFT_CRANK;
cps_init.sensor_location = &sensor_location;
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&cps_init.cp_sensor_loc_attr_md.read_perm);
err_code = ble_cps_init(&m_cps, &cps_init);
APP_ERROR_CHECK(err_code);
}