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

Reconnecting in central mode

I am developing an application on nRF52 wich simultaneously acts as a central and peripheral and I am using the Peer Manager to manage bonding. The central needs to stay connected with a few already bonded peripherals which can occasionally get out or reach and disconnect. Therefore, if not all peripherals are connected, a scanning will be constantly running. The application parses all received advertising reports and first filter them out based on the Manufacturing specific data and then on the Flags. And here it comes the question - how do I filter out the advertising reports further and distinguish the ones coming from devices which have already got a valid bond with this particular central? Does the Peer Manager or the ID Manager provide this functionality or the application needs to keep track on that based on for instance peer addresses?

Parents
  • Hi GT,

    Yes, you can manually check the address of the advertiser when you receive advertising and compare to the list of device connected/paired.

    But the esier way is to let the radio filter out advertising packets for you automatically. You can do that by providing a whitelist to the softdevice when doing scanning. The list of paired device can be acquired by calling pm_whitelist_get(). You will have address and IRK of the devices paired, and you can do selective scanning based on this list.

    Please have a look at the scan_start() function in main.c in ble_app_hrs_c project in our SDK.

  • The values are:

    addr.addr_id_peer = 0
    addr.addr_type = 1
    addr -> conatins the expected address of the device
    

    The scan_params:

    m_scan_params.active = 0
    m_scan_params.use_white_list = 1
    m_scan_params.adv_dir_report = 0
    

    m_scan_params intervals and window have the expected value. The same goes to the m_connection_param.

Reply Children
No Data
Related