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

Order of responses for GATT read/write requests

Hi,

Is there a possibility that the order of the responses can be different with respect to the order of the requests?

We check for the success status of the APIs sd_ble_gattc_read() and sd_ble_gattc_write() and expect the response in the same order. But sometimes, quite randomly order is not correct. We don't have logs unfortunately.

Side note:

We have 32 length characteristic value. Peripheral first sends 20 bytes data as an Indication and from the Central we try to read the remaining bytes from offset 20. This read request is called from the event handler. Do you see any problem in this approach? Normally it works just fine.

Parents
  • Hi Sharan

    What SoftDevice version are you using? It seems from the API, that only writes without response may be queued.

    Here's a new update from the developers as well:

    "Is the below example a correct understanding of the problem?

    Customer is investigating an issue reported in field, and is concerned about their code expecting that SoftDevice events caused by GATT server responses from peer are in the same order as GATT client requests have been issued. Customer wants to confirm whether the SoftDevice allows more than one request to be issued without waiting for a response. As an example, is the order of events below possible?

     

    1. sd_ble_gattc_read is called, returns NRF_SUCCESS
    2. sd_ble_gattc_write is called, returns NRF_SUCCESS
    3. Event is generated, read response is expected since the read was issued first, but write response is the actual event
    4. Event is generated, write response is expected, but read response is the actual event"

    Best regards,

    Simon

Reply
  • Hi Sharan

    What SoftDevice version are you using? It seems from the API, that only writes without response may be queued.

    Here's a new update from the developers as well:

    "Is the below example a correct understanding of the problem?

    Customer is investigating an issue reported in field, and is concerned about their code expecting that SoftDevice events caused by GATT server responses from peer are in the same order as GATT client requests have been issued. Customer wants to confirm whether the SoftDevice allows more than one request to be issued without waiting for a response. As an example, is the order of events below possible?

     

    1. sd_ble_gattc_read is called, returns NRF_SUCCESS
    2. sd_ble_gattc_write is called, returns NRF_SUCCESS
    3. Event is generated, read response is expected since the read was issued first, but write response is the actual event
    4. Event is generated, write response is expected, but read response is the actual event"

    Best regards,

    Simon

Children
Related