This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

recover from BLE_GATTC_EVT_TIMEOUT

I have an nrf51822 S110 based application that tries to discover the primary services on the GATT server at every connection of a central.

Unfortunately, the central does not always have a GATT server to respond to the service discovery and this ends up with a BLE_GATTC_EVT_TIMEOUT.

What I experience is that after this timeout event, all the write requests to the peripheral characteristics from the central are not reported by the S110 softdevice.

To get it back to a normal state, I have to disconnect the central and reconnect which triggers the services discovery again.

Is there anything to do to clear this GATT client failing procedure and not have to disconnect the link?

Thanks

Parents
  • No, this is required per spec.

    Bluetooth Spec 4.1, Volume 3, Part F, Chapter 2:

    "A transaction not completed within 30 seconds shall time out. Such a transaction shall be considered to have failed and the local higher layers shall be informed of this failure. No more attribute protocol requests, commands, indications or notifications shall be sent to the target device on this ATT Bearer."

    This rule is usually applied to many of the different protocol channels, but with varying timeouts. The only way to reset this state is to set up a new connection to the device, as this creates a new ATT Bearer.

    When you mention that the central does not always have a GATT server, do you mean that it sometimes does not have the time or resources to respond to the request - or that there simply is nothing to discover? In the latter case, the central device would be lacking mandatory services and break the spec. If it is not able to respond in a timely manner, it should tear down the link and set it back up when it has the resources to do so.

Reply
  • No, this is required per spec.

    Bluetooth Spec 4.1, Volume 3, Part F, Chapter 2:

    "A transaction not completed within 30 seconds shall time out. Such a transaction shall be considered to have failed and the local higher layers shall be informed of this failure. No more attribute protocol requests, commands, indications or notifications shall be sent to the target device on this ATT Bearer."

    This rule is usually applied to many of the different protocol channels, but with varying timeouts. The only way to reset this state is to set up a new connection to the device, as this creates a new ATT Bearer.

    When you mention that the central does not always have a GATT server, do you mean that it sometimes does not have the time or resources to respond to the request - or that there simply is nothing to discover? In the latter case, the central device would be lacking mandatory services and break the spec. If it is not able to respond in a timely manner, it should tear down the link and set it back up when it has the resources to do so.

Children
No Data
Related