Device discovery when bonded devices re-connect

Is it necessary to perform the GATT device discovery process whenever two bonded device re-connect?

I'm using two nRF54L15-DK boards, one is Central and one peripheral.
Developing with nRF Connect SDK v3.3.0.

I have set it up so initially the devices are not bonded.  The first time they connect the Central automatically initiates device pairing and bonding using "Just Works".  The Central then performs Device Discovery and reads some data from the peripheral then disconnects.   There is no need to stay in a connection as the data doesn't change often.  The peripheral will wake-up, advertise and re-establish a connection maybe hours later when it has updated data. The question is, having performed device discovery on the first connection does the Central need to perform it each time the two devices re-connect?

Parents
  • Hi,

    The central generally does not need to perform database discovery again on a bonded device, no. By default, peripherals in nRF Connect SDK has the Service Changed characteristic, which is used for indicating whether the GATT table has changed or not. This means the central may choose to cache the GATT table layout, thereby not having to perform Database Discovery on reconnection. Nevertheless, it all depends on the central, whether the central does the caching or not. Some centrals do, others do not.

    Regards,
    Terje

Reply
  • Hi,

    The central generally does not need to perform database discovery again on a bonded device, no. By default, peripherals in nRF Connect SDK has the Service Changed characteristic, which is used for indicating whether the GATT table has changed or not. This means the central may choose to cache the GATT table layout, thereby not having to perform Database Discovery on reconnection. Nevertheless, it all depends on the central, whether the central does the caching or not. Some centrals do, others do not.

    Regards,
    Terje

Children
  • Terje,

    Thanks for your reply.  This makes sense and is useful as device discovery on every re-connection takes time.
    We want the bonded devices to connect quickly, upload some data to the Central then disconnect.

    If the peripheral resets, either by software reset or power cycle, does the GATT table and all the attribute handles stay the same?

Related