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

Can I reduce the negotiation time of Bluetooth nRF51822

image description

Follow up this image. I want to reduce the negotiation time.

10:44:43.655 --> Connected to D6:9E...

10:44:45.123 --> Services Discovered

= 45.123 - 43.655 = 1.468 Sec

I want reduce to 300ms. How can I do?

Thank you in advance.

Parents
  • Yes, lowering connection interval is most powerful method in general but as it is controlled by central side you cannot really force it (e.g. most of the phones will drop connection if you try to set values below 20ms through Preferred Connection Parameters). But in case you are owner of peripheral side then hints are obvious:

    • Lower number of GATT handles in the stack to minimum (should be 8 with standard Nordic Soft Devices).
    • Do not include "Service Changed" Characteristic so Central side will cache GATT handles and should skip whole enumeration during Service Discovery when connecting next time (this is what Marius describes but it's not linked to bonding because I suppose even if you bond device will do enumeration when you indicate that your services might change). Note that this caching is done by low level FW on central side usually (if it is phone/tablet/PC...) so you cannot control it from application layer (apart from forcing deleting of the record) and it can get "erased" under different conditions (e.g. phone FW upgrade, wipe of network settings, cache overflow, some record might be considered too old etc.)

    In the best case you control both sides (HW&FW) and then simply make your GATT stack static on peripheral side, use the lowest connection interval of 7.5ms from central side (unless you need to keep connection with multiple peripherals where such low connection interval doesn't scale - that's the reason why most of the phone OS releases today set default connection interval to 30-50ms and prevent you going below) and hardcode handle numbers of your GATT Services/Characteristics/Descriptors on central side so you can issue GATT commands to them straight after the connection without any discovery.

    Cheers Jan

Reply
  • Yes, lowering connection interval is most powerful method in general but as it is controlled by central side you cannot really force it (e.g. most of the phones will drop connection if you try to set values below 20ms through Preferred Connection Parameters). But in case you are owner of peripheral side then hints are obvious:

    • Lower number of GATT handles in the stack to minimum (should be 8 with standard Nordic Soft Devices).
    • Do not include "Service Changed" Characteristic so Central side will cache GATT handles and should skip whole enumeration during Service Discovery when connecting next time (this is what Marius describes but it's not linked to bonding because I suppose even if you bond device will do enumeration when you indicate that your services might change). Note that this caching is done by low level FW on central side usually (if it is phone/tablet/PC...) so you cannot control it from application layer (apart from forcing deleting of the record) and it can get "erased" under different conditions (e.g. phone FW upgrade, wipe of network settings, cache overflow, some record might be considered too old etc.)

    In the best case you control both sides (HW&FW) and then simply make your GATT stack static on peripheral side, use the lowest connection interval of 7.5ms from central side (unless you need to keep connection with multiple peripherals where such low connection interval doesn't scale - that's the reason why most of the phone OS releases today set default connection interval to 30-50ms and prevent you going below) and hardcode handle numbers of your GATT Services/Characteristics/Descriptors on central side so you can issue GATT commands to them straight after the connection without any discovery.

    Cheers Jan

Children
Related