Whitelisting to connect to the bonded device

Hallo, hope you are having a good time.

I am using nRF SDK 17.02 and uses SES as an IDE.

Soft device S140 7.2.0

I have an application running which act as a central device. This central device connects and communicate with a single sensor (nrf52840). 

In my application on the central side, I need the following feature.

There will be number of central and peripheral devices lying around. Once the central device is connected with a perticular peripheral sensor, i need the central device to scan and try to conenct with the same periipheral device after a power reset. If the central device could not find that perticular device even after 10 seconds, it should be possible to scan for other sensors arround it and establish a connection with one of them.

In my application I uses UUID based filtering.

    err_code = nrf_ble_scan_filter_set(&m_scan, SCAN_UUID_FILTER, &m_fm_uuid);
    APP_ERROR_CHECK(err_code);

    err_code = nrf_ble_scan_filters_enable(&m_scan, NRF_BLE_SCAN_UUID_FILTER, false);
    APP_ERROR_CHECK(err_code);

I do not use any sort of whitelisting in my application. Can this feature be added with the help of whitelisting?

I read a lot of forum post but could not find a solution. I would really appreciate your help.

Best regards,

Adarsh

Parents
  • Hi. 

    I do not use any sort of whitelisting in my application. Can this feature be added with the help of whitelisting?

    Yes, that is a possibility. You can add the necessary information to the whitelist when you connect to the sensor the first time. 

    Note that you will have to disable the whitelist in order to scan and establish a connection with another device. 

    Br,
    Joakim

  • Hai Joakim,

    Thanks for your swift response.

    I have been following ble_app_hrs_c example. I am a bit confused with my approach. 

    Here is my use case:

    There are two sensors developed with nrf52840 SoC. One act as peripheral and other as central device. 

    I have been performing UUID scan filtering (without whitelisting) in the central application. So that the central device gets connected to only peripheral devices with a perticular UUID. 

    So far so good. However, my application demands a feature where once a connection was established between a pair of central and peripheral sensor, the central should try and connect with that perticular sensor for the next power cycle. There will be plenty of same kind of peripheral devices lying arround.

    And if the central device is not able to find the previously connected peripheral sensor, it then should start scanning for be ready to send connection request to other peripheral devices lying around. This is the required feature.

    I was hoping to save IRK or other details of the peripheral device in the flash memory of the central device after bonding (using peer manager / FDS). And then add these to the whitelist. If the central device is not able to find the same peripheral sensor for a duration of 10 seconds after a reset (power cycle), then the application deletes the peer, connect and bond with an other sensor with the UUID filtering and then repeats the proceedure again.

    I am not sure if this is the best approach for a quick solution. I would really appreciate your feedback here. What could be the best possibility here? Are there any reference application that I can study to perform the same?

    Thank you for your time.

    best regards,

    Adarsh  

Reply
  • Hai Joakim,

    Thanks for your swift response.

    I have been following ble_app_hrs_c example. I am a bit confused with my approach. 

    Here is my use case:

    There are two sensors developed with nrf52840 SoC. One act as peripheral and other as central device. 

    I have been performing UUID scan filtering (without whitelisting) in the central application. So that the central device gets connected to only peripheral devices with a perticular UUID. 

    So far so good. However, my application demands a feature where once a connection was established between a pair of central and peripheral sensor, the central should try and connect with that perticular sensor for the next power cycle. There will be plenty of same kind of peripheral devices lying arround.

    And if the central device is not able to find the previously connected peripheral sensor, it then should start scanning for be ready to send connection request to other peripheral devices lying around. This is the required feature.

    I was hoping to save IRK or other details of the peripheral device in the flash memory of the central device after bonding (using peer manager / FDS). And then add these to the whitelist. If the central device is not able to find the same peripheral sensor for a duration of 10 seconds after a reset (power cycle), then the application deletes the peer, connect and bond with an other sensor with the UUID filtering and then repeats the proceedure again.

    I am not sure if this is the best approach for a quick solution. I would really appreciate your feedback here. What could be the best possibility here? Are there any reference application that I can study to perform the same?

    Thank you for your time.

    best regards,

    Adarsh  

Children
Related