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

Read and write is not working in custom characteristics

Hi,

i have created some custom characteristics and i am enabling read and write characteristics in that, but when i am trying to write or read some data it seems that it is not working.

// characteristics initialization

memset(&add_char_params, 0, sizeof(add_char_params));
add_char_params.uuid = CUSTOM_VALUE_CHAR_UUID;
add_char_params.uuid_type = p_cus->uuid_type;
add_char_params.init_len = sizeof(uint8_t);
add_char_params.max_len = sizeof(uint8_t);
add_char_params.char_props.read = 1;
add_char_params.char_props.notify = 1;
add_char_params.char_props.write = 1;

add_char_params.read_access = SEC_OPEN;
add_char_params.cccd_write_access = SEC_OPEN;

err_code = characteristic_add(p_cus->service_handle, &add_char_params,
&p_cus->custom_value_handles[2]);

 

Related