This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Cannot initialize CyclingPower service

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);
}

Parents
  • Hi,

    It used to work, but then something happened

    What is the last thing you changed in the code?

    Could you debug the code and see what error code you get?

  • Well, it is not that simple unfortunately. I completely reverted back all (small) changes I made, but with no success.

    I don't get any errros, both at the compile stage and in the rutime.

    I increased log verbosity level to 4, but no errors. At connect, I get 0x50, 0x12 and 0x52 statuses.

    Where can I get their meaning?

    I also tried to increase NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE to 2000, it didn't help

    Symptom I have: the service is not listed in nRF Connect after the connection. All other services are listed, with their characterics.

    The service IS listed in adv packet, but thats another story.

Reply
  • Well, it is not that simple unfortunately. I completely reverted back all (small) changes I made, but with no success.

    I don't get any errros, both at the compile stage and in the rutime.

    I increased log verbosity level to 4, but no errors. At connect, I get 0x50, 0x12 and 0x52 statuses.

    Where can I get their meaning?

    I also tried to increase NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE to 2000, it didn't help

    Symptom I have: the service is not listed in nRF Connect after the connection. All other services are listed, with their characterics.

    The service IS listed in adv packet, but thats another story.

Children
No Data
Related