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

Recieved Gatt timeout error when tried to generate a read request event

I'm trying to create a read event whenever a certain characteristic is read. I used  BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST event to monitor that. I also set "is_defered_read" to true in the code as shown below tot the service initialization code:

add_char_params.char_props.read = 1;
add_char_params.char_props.write = 1;
add_char_params.is_defered_read=1;
add_char_params.read_access = SEC_OPEN;
add_char_params.write_access = SEC_OPEN;

the problem is that when I do that, NRF_connect freezes for a few seconds and then gives me "Gatt timeout error"

If I remove "add_char_params.is_defered_read", the code works normally again.

I'm not sure what I'm doing wrong here. I appreciate any comments.

Thanks.

Parents
  • Hi

    You're right, I was able to reproduce this by adding your snippet there to one of our examples, and the problem is that you've set both add_char_params.is_defered_read=1; and add_char_params.char_props.read = 1; which causes a conflict on which read parameter to use. If you remove add_char_params.char_props.read = 1; or set it to 0, you should see that defered_read will be used.

    Best regards,

    Simon

Reply
  • Hi

    You're right, I was able to reproduce this by adding your snippet there to one of our examples, and the problem is that you've set both add_char_params.is_defered_read=1; and add_char_params.char_props.read = 1; which causes a conflict on which read parameter to use. If you remove add_char_params.char_props.read = 1; or set it to 0, you should see that defered_read will be used.

    Best regards,

    Simon

Children
Related