Hi i am using SDK15.2 nrf52832.
What is peer id?
Which function is adding device mac address to whitelist?
how does the whitelisting process implemented in HID example code?
Hi i am using SDK15.2 nrf52832.
What is peer id?
Which function is adding device mac address to whitelist?
how does the whitelisting process implemented in HID example code?
Hi,
If you set: init.config.ble_adv_whitelist_enabled = true;
before calling: err_code = ble_advertising_init(&m_advertising, &init);
Then the advertisement will ask for the whitelist by BLE_ADV_EVT_WHITELIST_REQUEST in on_adv_evt(). Look at the hid keyboard example how the application request the peer manager to create the whitelist from already bonded peers.
Best regards,
Kenneth
Thanks Kenneth, Is Bonding is mandatory for whitelisting activity?
will i be able to proceed without bond and pairing process to whitelist devices?
Rekha said:Is Bonding is mandatory for whitelisting activity?
It is typically used to whitelist devices that have been previously bonded yes. But you may just add devices (if you know the gap address of the peer) as you see fit on BLE_ADV_EVT_WHITELIST_REQUEST.
But you may just add devices (if you know the gap address of the peer) as you see fit on BLE_ADV_EVT_WHITELIST_REQUEST.
how to add Known MAC ID to the whitelist without bonding ?
You can use the BLE_GAP_EVT_SCAN_REQ_REPORT event, because this event include RSSI value and GAP address of the scanner, and based on this you can the for instance add the scanner to the whitelist if you want to allow connection.
For this to work you should set BLE_GAP_ADV_FP_FILTER_CONNREQ when advertisement, since it will allow all peers to send scan request (cause BLE_GAP_EVT_SCAN_REQ_REPORT event), but only those in the whitelist can connect.
You can use the BLE_GAP_EVT_SCAN_REQ_REPORT event, because this event include RSSI value and GAP address of the scanner, and based on this you can the for instance add the scanner to the whitelist if you want to allow connection.
For this to work you should set BLE_GAP_ADV_FP_FILTER_CONNREQ when advertisement, since it will allow all peers to send scan request (cause BLE_GAP_EVT_SCAN_REQ_REPORT event), but only those in the whitelist can connect.
Thank you, But i how to enable BLE_GAP_EVT_SCAN_REQ_REPORT event in event handler? because i followed many blogs but i could not achieve it.
also, how to add MAC ID to whitelist directly in the case BLE_ADV_EVT_WHITELIST_REQUEST: Please post the code snippet if possible.
can i use sd_ble_gap_whitelist_set() to set the whitelist with MAC ID as input?
If you are using the advertisement module you simple stop and start advertisement, and then on BLE_ADV_EVT_WHITELIST_REQUEST event you call ble_advertising_whitelist_reply() with the desired peer.
If you are not using the advertisement module it should be possible to call sd_ble_gap_whitelist_set() directly yes.