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

Whitelist filter policy

My setup is NRF52DK+SD132_V3.1.0+SDK_12.2.0.

While playing with my peripheral I setup a whitelist, the default whitelist filter policy seems to be BLE_GAP_ADV_FP_FILTER_CONNREQ (I made that conclusion because NOT whitelisted centrals are able to send scan request and successfully get scan response but they are unable to connect).

Now I want to change the filter to a different value, say BLE_GAP_ADV_FP_FILTER_SCANREQ, while searching forums and documentation it seems like right way to achieve that is to leverage sd_ble_gap_adv_start but I am already leveraging another function to setup advertising - ble_advertising_init but this function doesn't seem to provide an option to set/change the filter policy. Is that OK/by design to use both of them ? If so, isn't it a little bit confusing because, as I understand, once any of them completes the advertising is technically up an running.

  • If you are using the advertising module I wouldn't start calling sd_ble_gap_adv_start() directly.

    I would rather change the define in the library.

    Or modify the library so that you can change the filter policy.

    Or implement my own advertising module.

  • I technically don't have a preference as of now, I just followed BLE Advertising, a beginner's tutorial which uses the Advertising Module.

    Above you enumerated several options but none of them seems to recommend using sd_ble_gap_adv_start did I get you right - you don't recommend that route?

    What general rule I should use while deciding whether to use Soft Device functions or the SDK functions? I am asking because from the answer above it seems like they are not necessary compatible in all cases, did I get it right? Also, it would be good to understand why both: SDK (which contains those modules if I got you right) and Soft Device exist and not just one. Both of them seem to be like some sort of SDK because both of them contain set of functions which should help me while building my application, and for an app builder, would be easier (including searching forum and doc) to just have 1.

  • I recommend chosing one of the above, not a mix of them. Not use library while at the same time calling sd_ble_gap_adv_start() directly. In general you have more control if you use the SoftDevice functions directly, but you may have to use more time understanding what they do, instead of letting the library handle everything for you. I don't know what the right choice is for you. The SoftDevice is implemented according to the Bluetooth specification, with all mandatory features. If is qualified by the Bluetooth SIG to ensure interoperability with other vendors. It is not open source. You cannot change it. The SDK is developed to ease the use of the SoftDevice, and implements functionality that not everyone needs, like for example bond management, or an advertising management.

  • Thanks, I ended up modifying the Advertising Module as you suggested and got the behavior I was looking for.

  • Hi ,

    From your reply I hope you could get your work done.

    I am tryuing to implement a whitelist,(with SDK15,S132 and nRF52832)

    I was struggling for a long time. 

    Still I could not succeed.

    Will you be able to provide a working sample example using whitelist

    with regards,

    Geetha

Related