Central connect to Peripheral without scanning

I have an existing BLE Peripheral device based on nRF52832 which is running GATT and advertising with a long period to conserve power.

What I now need to do is use another nRF device in Central mode to connect to it, write, then disconnect after a user presses a pushbutton. To conserve power this nRF will be in deep sleep or more likely powered off between button presses.

If I know the peer address of the peripheral device is there a way to connect directly i.e. without scanning in order to reduce both power consumption and latency? The only way I've seen in the examples or docs so far is whitelist>scan>connect.

Parents Reply
  • Yes.

    When we do normal scanning then connecting, we are first reading the advertisements to find a device that we want to connect. In the advertisement event what we want to connect to, we call sd_ble_gap_connect, and one of the input parameters of this function is the address, which we get from the advertising packet. Then the central will continue to scan, because it needs to send the connection packet directly after an advertising packet.

    If you skip the scanning and just connect, it will be able to connect to the first advertising packet that it picks up. But scanning and then connecting takes at least two advertising packets.

Children
Related