I want to use white list scanning in my project, but after setting them to controller, it seems have no effect, my setting process as below:
1) Gap_ReadWhiteListSize and check general callback event of gWhiteListSizeRead_c
2) Gap_ClearWhiteList and check its event
3) Gap_AddDeveiceToWhiteList and check its event until 4 mac address set into controller
4) Gap_StartScanning with filterPolicy of gScanWithWhiteList_c, and gScanStateChanged_c event callback
After 4steps, I send the ble advertising of ADV_NONCONN_IND with the mac address on whitelist, but no gDeviceScanned_c event happen, is there any problem of my setting and process?
Thank you.
Hello,
Hope you are doing well.
You can use the Gap_AddDeviceToWhiteList() function to add devices to the white list, and then configure the filter policy of the scanning parameters in the gScanParams structure to scan using the white list (gScanWithWhiteList_c).
If a bond is created, device address should be written in controller's white list in response to gConnEvtPairingComplete_c when gAppUseBonding_d is set to 1.
If you want to perform active scanning and only scan for devices in a white list (list of devices that LL uses for device filtering), you can implement the following code (extracted from BLE Application Developer's Guide, Chapter 4.1.1) on Central device:
gapScanningParameters_t scanningParameters = gGapDefaultScanningParameters_d;
scanningParameters.type = gGapScanTypeActive_c;
scanningParameters.filterPolicy = gScanWhiteListOnly_c;
Gap_StartScanning(&scanningParamters, scanningCallback, enableFilterDuplicates, duration, period);
Are you using public or random address? What is the value that you have on privacy (gAppUsePrivacy_d)?
Best regards,
Ana Sofia.
Hi, sofiaurueta
Thanks for your reply.
Are you using public or random address? What is the value that you have on privacy (gAppUsePrivacy_d)?
--> I am not sure, I think we use public address with no privacy currently for testing.
If a bond is created, device address should be written in controller's white list in response to gConnEvtPairingComplete_c when gAppUseBonding_d is set to 1.
--> Do you mean the device need to be connected once with KW36? Does it mean bond is a necessary pre-condition?
If you want to perform active scanning and only scan for devices in a white list (list of devices that LL uses for device filtering)
--> The operation need SCAN_RSP, but we just want to receive ADV data and the device will not response the SCAN_REQ. If whitelist already exist in controller, does scan passive with whitelist can receive the ADV data on whitelist?
Sorry, a lot of questions, Thank you so much.