Is it possible to whitelist only selected peer(s)?

Hi,

is at the moment possible with S110 (nRF51 SDK) to whitelist only SOME of bonded peers? I need to allow connection from one selected central. Selection is made by user right before advertisement starts.

Thanks a lot,

Tom

Parents
  • From a SoftDevice perspective it is possible. The application decides what addresses/IRKs that should be given to sd_ble_gap_adv_start().

    You just need to figure out what the address/IRK of the central is and put it into the whitelist.

    Edit 07.10.2015 I may have a solution.

    You have four slots, so set up device manager to store maximum 4 bonds.

    The user presses button 2. This notifies the main application that slot 2 should be used. Then advertise->connect->bond. When bonding is complete the BLE_GAP_EVT_AUTH_STATUS event will be received by the main application. This event is handled by device manager, but in it you can find information like if the bonding was succesful (p_ble_evt->evt.gap_evt.params.auth_status.auth_status), if bonding was performed (p_ble_evt->evt.gap_evt.params.auth_status.bonded). So you can check if these are correct and then you can call dm_whitelist_create().

    This will return two lists, one with addresses and one with IRKs. At this point there should only be one address or one IRK in the lists. You take this IRK or address and store it in slot 2 in a struct in your main application.

    If then button 3 is pressed most of the procedure will be repeated but you will have 2 addresses/IRKs in the lists when you call dm_whitelist_create(). Compare the address/IRK of slot 2 (and the other slots that are not empty) to figure out which one is the new address/IRK and store it in slot 3.

    Bond deletion. When you call dm_whitelist_create() you can also call dm_handle_get(). Then you will get the dm handle of the bond you are currently in connection with. Store this in the correct slot together with the IRK/address. Then if button 2 is long pressed (for example) you know what dm handle to use when you call dm_device_delete() to delete the bond in the device manager. Then clear the slot..

    The device manager stores bonds persistently, so I would store the slots persistently as well.

    This may work, and it doesn't require you to change the device manager library. It is just an idea though.

Reply Children
No Data