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 Reza

    Sorry, seems like I misunderstood the defered_read setting. It should work as intended if you set the rd_auth bit in ble_gatts_attrib_md_t as well as all the parameters you've set in your initial ticket.

    Best regards,

    Simon

  • Hi Simon,

    It didn't help.  I'm not sure if I need to set rd_auth bit in ble_gatts_atrib_md_t, because Inside characteristic add there is the following line: 

                                             attr_md.rd_auth    = (p_char_props->is_defered_read ? 1 : 0);

    so when I set "is_defered_read"  to 1 in my services_init  function  , it should automatically set  set rd_auth bit  to 1.  

    I followed the tips mentioned here. but still the same problem (NRF_connect freezes followed by "Gatt timeout error"). I'm not sure why goes wrong. I wonder if you have any recommendations?

    Thanks,

    Reza

Reply
  • Hi Simon,

    It didn't help.  I'm not sure if I need to set rd_auth bit in ble_gatts_atrib_md_t, because Inside characteristic add there is the following line: 

                                             attr_md.rd_auth    = (p_char_props->is_defered_read ? 1 : 0);

    so when I set "is_defered_read"  to 1 in my services_init  function  , it should automatically set  set rd_auth bit  to 1.  

    I followed the tips mentioned here. but still the same problem (NRF_connect freezes followed by "Gatt timeout error"). I'm not sure why goes wrong. I wonder if you have any recommendations?

    Thanks,

    Reza

Children
No Data
Related