Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF Connect (Desktop) reports 'Received a Gatt timeout'

Hi,

I working on a BLE app with 2 custom services.

When I try to expand a characteristic I get a spinning indicator below the characteristic and after a while I get a 'Received a Gatt timeout'.

If instead I just try to write to a characteristic I immediately get a 'Characteristic value write failed: A gatt operation already in progress with device id xxxx.'

In my BLE event handler I only see the following events:

BLE Event: BLE_GAP_EVT_CONNECTED (0x0010).
BLE Event: BLE_GATTC_EVT_EXCHANGE_MTU_RSP (0x003A).
BLE Event: BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST (0x0023).
BLE Event: BLE_GAP_EVT_DATA_LENGTH_UPDATE (0x0024).
BLE Event: BLE_GATTS_EVT_SYS_ATTR_MISSING (0x0052).
BLE Event: BLE_GAP_EVT_CONN_PARAM_UPDATE (0x0012).

I do not see any events in the GATT event handler.

How do I find out what is going wrong? I'm totally lost here.

I'm using an nRF52840 with SDK 15.0.0.

Thanks in advance.

Kind regards,

Remco Poelstra

Parents
  • Can you try to set all the characteristics for the service in question to open (with no security required) and also allow read property? If that works then you know that you will have to try and fail a bit until you can identify which property is causing the problem.

    Best regards,
    Kenneth

  • Thanks for your reply.

    Below are some excerpts of code, which I believe set the properties you mention:

    //Allow the peer to actually write and/or read from the characteristic value
    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&serviceSettings.sercurityOptions.read_perm);
    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&serviceSettings.sercurityOptions.write_perm);
    
    //Read operation on Cccd should be possible without authentication.
    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&cccdMd.read_perm);
    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&cccdMd.write_perm);


    //set the properties that will be displayed to the central during service discovery. charMd.char_props.read = true; //characteristic->read; charMd.char_props.write = characteristic->write; charMd.char_props.notify = characteristic->notify; charMd.p_char_user_desc = NULL; charMd.p_char_pf = NULL; charMd.p_user_desc_md = NULL; charMd.p_cccd_md = &cccdMd; charMd.p_sccd_md = NULL; //actually set the properties(i.e. accessability of the attribute).
    attrMd.read_perm = serviceSettings->sercurityOptions.read_perm; attrMd.write_perm = serviceSettings->sercurityOptions.write_perm; attrMd.vloc = BLE_GATTS_VLOC_STACK; attrMd.rd_auth = 0; attrMd.wr_auth = 0; attrMd.vlen = 0;  

    This makes no difference however.

Reply
  • Thanks for your reply.

    Below are some excerpts of code, which I believe set the properties you mention:

    //Allow the peer to actually write and/or read from the characteristic value
    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&serviceSettings.sercurityOptions.read_perm);
    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&serviceSettings.sercurityOptions.write_perm);
    
    //Read operation on Cccd should be possible without authentication.
    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&cccdMd.read_perm);
    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&cccdMd.write_perm);


    //set the properties that will be displayed to the central during service discovery. charMd.char_props.read = true; //characteristic->read; charMd.char_props.write = characteristic->write; charMd.char_props.notify = characteristic->notify; charMd.p_char_user_desc = NULL; charMd.p_char_pf = NULL; charMd.p_user_desc_md = NULL; charMd.p_cccd_md = &cccdMd; charMd.p_sccd_md = NULL; //actually set the properties(i.e. accessability of the attribute).
    attrMd.read_perm = serviceSettings->sercurityOptions.read_perm; attrMd.write_perm = serviceSettings->sercurityOptions.write_perm; attrMd.vloc = BLE_GATTS_VLOC_STACK; attrMd.rd_auth = 0; attrMd.wr_auth = 0; attrMd.vlen = 0;  

    This makes no difference however.

Children
No Data
Related