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

S130: Simultaneous connecting to multiple peripherals

Hi,

the S130 supports multiple connections for the Central role. Is it possible to connect to multiple devices at the same time? E.g. calling sd_ble_gap_connect() asynchronously multiple times with different peer addresses before a timeout or a connection event has occured.

My goal is to have multiple central services/profiles that handle their connections independently of each other. Is this possible? Or will I need to use some kind of connection manager that synchronizes GAP access between the services?

Also, we will have an Observer running in background. Will it be possible to keep scanning during connection establishment to peripheral devices? In the past, it seems I had to call sd_ble_gap_scan_stop() before calling sd_ble_gap_connect().

Parents
  • You can only connect to one device at the time. You can do this by either providing a peer address, or you can provide a whitelist with multiple addresses/IRKs. If you provide a whitelist, it will try to connect to the first advertisment that get a match with the whitelist. Then you will have to call sd_ble_gap_connect() again to connect to a second device, and so on.

    If you are scanning, and you call sd_ble_gap_connect() the "old" scan will be stopped. This had to be done manually with the S120 I believe. So the SoftDevice doesn't allow you to observe while you are trying to connect. If this is an important feature, it may be possible to implement the observer with the timeslot API.

  • Thanks, then the whitelist might be something that helps us doing a clean implementation. So stopping the scanning manually is not needed on the S130 stack? My current strategy for the scenario described above would be as follows:

    1. In idle mode, try to connect to B, C and D using the whitelist
    2. When the trigger event is detected, stop connecting from 1) and enter scan mode. Find the correct device (X, Y, Z) and connect to it. After the connection is established, continue with whitelist connecting to B, C and D, just like in 1).
Reply
  • Thanks, then the whitelist might be something that helps us doing a clean implementation. So stopping the scanning manually is not needed on the S130 stack? My current strategy for the scenario described above would be as follows:

    1. In idle mode, try to connect to B, C and D using the whitelist
    2. When the trigger event is detected, stop connecting from 1) and enter scan mode. Find the correct device (X, Y, Z) and connect to it. After the connection is established, continue with whitelist connecting to B, C and D, just like in 1).
Children
No Data
Related