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

adding custom characteristic to HRS

Hi All,

I am trying to add custom characteristic to existing HRS profile. I am making few modifications to this profile for my custom requirement. 

I am adding new characteristic like below. 

 

// Add Last Packet Counter characteristic FIXME: remove hardcoding
memset(&add_char_params, 0, sizeof(add_char_params));

add_char_params.uuid = MY_CUSTOM_UUID;
add_char_params.max_len = 2;
add_char_params.init_len = 2;
add_char_params.p_init_value = 0;
add_char_params.is_var_len = true;
add_char_params.char_props.read = 1;
add_char_params.char_props.write = 1;
//add_char_params.cccd_write_access = p_hrs_init->hrm_cccd_wr_sec;
add_char_params.read_access = p_hrs_init->bsl_rd_sec;

err_code = characteristic_add(p_hrs->service_handle, &add_char_params, &(p_hrs->hrm_handles));
if (err_code != NRF_SUCCESS)
{
return err_code;
}

This code doesn't throw any error return code. Which means the characteristic is getting added successfully. 

But after adding this, I unable to see the data, and application hangs somewhere in the code always restarts and starting advertisement. 

Is there anything to be taken  care of apart from simply adding characteristic? Please guide me. 

However I am creating completely a new custom profile for my application. Meanwhile I would like to experiment with adding characteristics to existing profile and see how it works.

Please let me know what I am doing wrong. 

Regards

Lakshmi 

Related