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

For a scanning unit, can the decision to connect be selective ?

I don't program the BLE part myself but I must know from a design-level.

As I understand, a BLE scanning unit must connect within less then 60us after advertisement. 

If let say 200 units make advertisements, can a scanning nRF52832 application decide to only connect to a selective part of those units ?

(provided that the scanner already has retrieved unit ID's, and compiled a list of selected ID's)

If so, briefly how is this then in principle done in realtime within 60us ?

Best regards Lennart Vedin for tss.se

  • Hi Lennart

    It is true that there is a receive window after every connectable advertisement packet sent where the scanner can send a connection request, but there is a 150us window between the end of the advertisement packet and the start of the connection request, not 60us. 

    The BLE scanner will usually not establish a connection on the first advertise packet received from an advertiser. Instead the first advertise packet will be reported to the application on the scanner side, where you can add some logic to decide if you want to connect to the device or not. 

    Once the scanner decides to connect to a specific device it will wait for the next advertise packet from that device, and send the connection request 150us later. 

    In this way the application has much longer time to decide which device(s) to connect to. 

    Best regards
    Torbjørn

  • Ok 150us window, thank you Torbjörn.

    Yes we have the approach you describe to decide before the next advertisement.

    add some logic to decide if you want to connect to the device or not.

    Our additional logic is not just "the device", but a list of devices e.g. 76 devices of 150 reported. I.e. after take decision for all those 76 devices, the scanner shall connect to any of those, who happen to make an advertisement. There are up to 200 units advertising typical every 15 second. And we want minimum delay to get all those 76 connected one by one.

    And again I just want to know if this is doable, no need how to. 

  • Hi Lennart

    Are you planning to use the Nordic SoftDevice, or are you planning to implement the BLE stack yourself?

    In the SoftDevice we have a whitelist feature, that allows you to define 8 BLE devices that you want to connect to. Then you can tell the SoftDevice to connect to the first of these 8 devices that advertise, and you will connect to the first one right away. 

    To support more than 8 devices you have to update the whitelist, and this means you will not be able to respond to the first advertise packet, but will have to connect on the second one. 

    If you are doing a custom stack implementation it is possible to have a longer list of devices (up to 150 no problem), and connect to the first one that appears, at least as long as the advertisers use a public or a random static address. If your advertisers use a private resolvable address then it is necessary to resolve the address before you can check if it is a match, and this will slow down the process significantly. 

    Best regards
    Torbjørn

  • Ok thank's again

    Now I know what is possible and some about the workload to implement it.

    I'm fine with that.

    Best regards Lennart

  • Hi Lennart

    Sounds good, I will consider the case closed then. 

    The best of luck with your project Slight smile

    Best regards
    Torbjørn

Related