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

Filter already connected peripherals in adv_report

Hello Nordic,

We have an NRF52840 with SDK 16.0.0 as central in our project and multiple peripherals (which are IOS or Android phones) are supposed to connect to it. 

In adv_report function we connect to every advertising paired device . To make sure we have only one connection to each peripheral, we need a way to detect already connected devices.

I tried using pm_address_resolve to get peer_id of each peripheral and use it to detect already connected devices but using this function continuously in adv_report made NRF52 freeze without any error reports.

I thought about using peer_addrss but I think IOS and Android devices change this address although I'm not sure about this. And if this is not the case, I don't know if only saving  uint8_t addr[BLE_GAP_ADDR_LEN]; in peer_address can solve this problem.

So I would like to know which part of the advertising data can I use to detect already connected peripherals? What is the best solution for this?

Thanks

Parents Reply Children
  • Sure,

    My application needs two feature which I couldn't add them using scanning module. 1. I have two advertising UUIDs which show me which kind of peripheral is going to be paired, 2- I should pair with these peripherals only if their advertising RSSI is blow a certain range.

    Because of these two I performed my application without scan module and I am using adv_report event directly to detect peripherals and connect to them.

    But now I need to add multi-connection feature to my application,and my question is this :

    Is it possible to still use this method and avoid using scanning module and have whitelist for managing connections?

    Thanks

Related