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

User description descriptor write event missing UUID and data

Hello -

I am working with the nRF52840-DK board and SDK 15.3.0. In my service, deployed on the nRF52840, I have a characteristic user description descriptor that is both readable and writable. The characteristic wr_aux field is set to 1. The client app is able to discover the characteristic user description descriptor and write to that descriptor. On the server side, it appears that the BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST event is generated, but the uuid value and len fields are both set to 0 and handle is set to 1024. All these values don't seem correct.

I use the characteristic_add() utility function in the server to add the characteristic and it's user description descriptor. The function works as expected elsewhere in my app. It only seems to fail in this use case. The code to add the user description descriptor (characteristic setup omitted) is roughly as follows:

ble_add_char_params_t add_char_params;
ble_add_char_user_desc_t add_user_desc;
uint8_t buffer[64];

add_user_desc.max_size = 64;
add_user_desc.size = 0;
add_user_desc.p_char_user_desc = buffer;
add_user_desc.is_var_len = 1;
add_user_desc.is_defered_read = 1;
add_user_desc.is_defered_write = 1;
add_user_desc.is_value_user = 1;
add_user_desc.char_props.read = 1;
add_user_desc.char_props.write = 1;
add_user_desc.char_props.write_wo_resp = 0;
add_user_desc.char_props.notify= 0;
add_user_desc.char_props.indicate= 0;
add_user_desc.read_access = SEC_OPEN;
add_user_desc.write_access = SEC_OPEN.
add_char_params.p_user_descr = &add_user_desc;

err_code = characteristic_add(service_handle, &add_char_params, &handles);

The err_code returned from characteristic_add() is 0. 

With respect to possible issues, I noticed that the p_char_user_desc field needs to point at a non-NULL buffer. This is different compared to the way I setup characteristics where I want the application to response to read/write requests. But if I provide a NULL buffer, the handles.user_desc_handle is set to 0 (BLE_GATT_HANDLE_INVALID).

How do I add a writable characteristic user description descriptor so that the server application can receive and process the data written?

Regards,

Brian

Related